On Friday 04 April 2014 17:24:04 David Heidelberger wrote: > >> /* Finally, add the read+execute ACL for $USER */ > >> +#ifdef HAVE_ACL > >> if (!add_acl (mount_dir, uid, error)) > >> +#else > >> + if (chown (mount_dir, -1, gid) == -1) > > > > add_acl seems to report an error if something fails, wouldn't that also > > be useful here? > > chown also report error
Actually, it doesn't. If chown fails, then it branches immediately to mkdir() so the errno is lost. Oh, and I just noticed that "error" is not set either, so the caller has no idea that this function failed. "%m" seems to be a glib-specific modifier that gets expanded to the error message. What about (typing from my hand, please excuse any errors): #ifdef HAVE_ACL if (!add_acl (mount_dir, uid, error)) { #else if (chown (mount_dir, -1, gid) == -1) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Failed to change gid to %d for %s: %m", (gint) gid, path); #endif Kind regards, Peter _______________________________________________ devkit-devel mailing list devkit-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/devkit-devel