From b93d9d705f8423a0ba01fa9caddfe4d1239c696c Mon Sep 17 00:00:00 2001
From: mahesh gondi <mashf13@gmail.com>
Date: Tue, 20 Mar 2012 17:20:06 +0000
Subject: [PATCH] utils: deprecate err(), use mk_err() as it should

Signed-off-by: mahesh gondi <mashf13@gmail.com>
---
 src/mk_utils.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/mk_utils.c b/src/mk_utils.c
index f724b8c..a60ee08 100644
--- a/src/mk_utils.c
+++ b/src/mk_utils.c
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <errno.h>
-#include <err.h>
 #include <ctype.h>
 #include <stdarg.h>
 #include <string.h>
@@ -182,8 +181,10 @@ int mk_utils_set_daemon()
 {
     pid_t pid;
 
-    if ((pid = fork()) < 0)
-        err(EXIT_FAILURE, "pid");
+    if ((pid = fork()) < 0){
+		mk_err("Error: Failed creating to switch to daemon mode(fork failed)");
+	    	exit(EXIT_FAILURE);
+	}
 
     if (pid > 0) /* parent */
         exit(EXIT_SUCCESS);
@@ -195,7 +196,10 @@ int mk_utils_set_daemon()
     setsid();
 
     if (chdir("/") < 0) /* make sure we can unmount the inherited filesystem */
-        err(EXIT_FAILURE, "chdir");
+	{
+		mk_err("Error: Unable to unmount the inherited filesystem in the daemon process");
+	    	exit(EXIT_FAILURE);
+	}
 
     /* Our last STDOUT message */
     mk_info("Background mode ON");
-- 
1.7.5.4

