commit ebb6b00bf66828c5a2587dd2cd44f8810e01e00b
parent 75a45548fa04584809d34550fbc4b43cd08c294e
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Sun, 16 Jul 2017 16:26:07 +0000
Fix ftrigw_fifodir_make on platforms where gid_t is unsigned (the BSDs, who would have thought!)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libs6/ftrigw_fifodir_make.c b/src/libs6/ftrigw_fifodir_make.c
@@ -19,7 +19,7 @@ int ftrigw_fifodir_make (char const *path, gid_t gid, int force)
if (!force) return 1 ;
}
else umask(m) ;
- if ((gid >= 0) && (chown(path, -1, gid) == -1)) return 0 ;
- if (chmod(path, (gid >= 0) ? 03730 : 01733) == -1) return 0 ;
+ if ((gid != (gid_t)-1) && (chown(path, -1, gid) == -1)) return 0 ;
+ if (chmod(path, (gid != (gid_t)-1) ? 03730 : 01733) == -1) return 0 ;
return 1 ;
}