Skip to contentSkip to conversation

little libselinux patch to display errno

PATCH Colin Walters 1 participant 1 message Aug 20, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi,

Here's a little patch to libselinux which causes it to print strerror(errno) if the AVC netlink socket can't be opened. I wasn't sure if there was a reason just the numeric value of errno was printed, so I kept it.

src/avc.c renamed from src/avc.c~ +2 -1
@@ -180,7 +180,8 @@
 
   rc = avc_netlink_open(avc_using_threads);
   if (rc < 0) {
-    avc_log("%s:  can't open netlink socket: %d\n", avc_prefix, errno);
+    avc_log("%s:  can't open netlink socket: %d (%s)\n", avc_prefix,
+	    errno, strerror(errno));
     goto out;
   }
   if (avc_using_threads) {