From fa164d91bdaf0d5aaf2a7093cf450d3c7930e9e3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 Nov 1998 12:40:37 +0000 Subject: check return value of locking_init() (This used to be commit 0efac70f756dce4c92744fc59b68b528f6984dee) --- source3/utils/status.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/source3/utils/status.c b/source3/utils/status.c index 344d46a9b9..fa1e8b43bf 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -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); -- cgit