/* The file descriptor corresponding to "path" */
int fd = 0;
- /* Split "path" into base/dirname parts to be used with openat().
- * We duplicate the strings involved because dirname/basename mangle
- * their arguments.
+ /* Get the parent directory of "path" with dirname(), which happens
+ * to murder its argument and necessitates a path_copy.
*/
char* path_copy = strdup(path);
if (path_copy == NULL) {