From: <ssm...@us...> - 2008-08-05 13:04:35
|
Revision: 2939 http://selinux.svn.sourceforge.net/selinux/?rev=2939&view=rev Author: ssmalley Date: 2008-08-05 13:04:32 +0000 (Tue, 05 Aug 2008) Log Message: ----------- Author: Russell Coker Email: ru...@co... Subject: setfiles patch Date: Fri, 1 Aug 2008 11:12:37 +1000 Currently "setfiles -p" doesn't print a new-line at the end, this is annoying as the output of the next command ends up starting halfway accross the screen. Here is a patch. Modified Paths: -------------- trunk/libselinux/src/setrans_client.c trunk/policycoreutils/setfiles/setfiles.c Modified: trunk/libselinux/src/setrans_client.c =================================================================== --- trunk/libselinux/src/setrans_client.c 2008-07-30 12:37:03 UTC (rev 2938) +++ trunk/libselinux/src/setrans_client.c 2008-08-05 13:04:32 UTC (rev 2939) @@ -13,7 +13,7 @@ #include <errno.h> #include <stdlib.h> #include <netdb.h> - +#include <fcntl.h> #include <stdio.h> #include <string.h> #include <ctype.h> @@ -42,11 +42,17 @@ { struct sockaddr_un addr; int fd; - - fd = socket(PF_UNIX, SOCK_STREAM, 0); - if (fd < 0) { +#ifdef SOCK_CLOEXEC + fd = socket(PF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); + if (fd < 0 && errno == EINVAL) +#endif + { + fd = socket(PF_UNIX, SOCK_STREAM, 0); + if (fd >= 0) + fcntl(fd, F_SETFD, FD_CLOEXEC); + } + if (fd < 0) return -1; - } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; Modified: trunk/policycoreutils/setfiles/setfiles.c =================================================================== --- trunk/policycoreutils/setfiles/setfiles.c 2008-07-30 12:37:03 UTC (rev 2938) +++ trunk/policycoreutils/setfiles/setfiles.c 2008-08-05 13:04:32 UTC (rev 2939) @@ -1017,5 +1017,7 @@ free(excludeArray[i].directory); } + if (progress) + printf("\n"); exit(errors); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |