Commit 4bd74ac5 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Merge branch 'wip/pwithnall/bsd-nofollow' into 'master'

gfileutils: Fix O_NOFOLLOW handling on BSD systems

See merge request !1591
parents 62a54a90 b4aa9d78
Pipeline #199289 passed with stages
in 13 minutes and 30 seconds
......@@ -1444,12 +1444,23 @@ consistent_out:
/* ELOOP indicates that @filename is a symlink, since we used
* O_NOFOLLOW (alternately it could indicate that @filename contains
* looping or too many symlinks). In either case, try again on the
* FreeBSD uses EMLINK instead of ELOOP
* (,
* and NetBSD uses EFTYPE
* ( */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
if (saved_errno == EMLINK)
#elif defined(__NetBSD__)
if (saved_errno == EFTYPE)
if (saved_errno == ELOOP)
return g_file_set_contents_full (filename, contents, length,
mode, error);
#endif /* O_NOFOLLOW */
set_file_error (error,
filename, _("Failed to open file “%s”: %s"),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment