check return value of locking_init()
authorAndrew Tridgell <tridge@samba.org>
Thu, 5 Nov 1998 12:40:37 +0000 (12:40 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 5 Nov 1998 12:40:37 +0000 (12:40 +0000)
(This used to be commit 0efac70f756dce4c92744fc59b68b528f6984dee)

source3/utils/status.c

index 344d46a9b981ab1104beaf4c828d45fcc45f40ce..fa1e8b43bfd806ef7cce80a351a6a86a3dd1cb27 100644 (file)
@@ -309,17 +309,19 @@ static void print_share_mode(share_mode_entry *e, char *fname)
   printf("\n");
 
   if (!shares_only) {
+         if (!locking_init(1)) {
+                 printf("Can't initialise shared memory - exiting\n");
+                 exit(1);
+         }
 
-    locking_init(1);
-
-    if (share_mode_forall(print_share_mode) <= 0)
-      printf("No locked files\n");
-    
-    printf("\n");
-
-    share_status(stdout);
-
-    locking_end();
+         if (share_mode_forall(print_share_mode) <= 0)
+                 printf("No locked files\n");
+         
+         printf("\n");
+         
+         share_status(stdout);
+         
+         locking_end();
   }
 
   return (0);