[Open-FCoE] [PATCH 04/15] fcoe-utils: remove SA_LOG_ERR_EXIT

Robert Love robert.w.love at intel.com
Thu Jul 16 17:00:42 UTC 2009


This function basically just did SA_LOG_ERR and then called
exit(). It also printed the function name it was called from.

The function name isn't that helpful as fcoemon is not a big
application.

This patch just has previous callers call SA_LOG_ERR and then
exit().

Signed-off-by: Robert Love <robert.w.love at intel.com>
---

 fcoemon.c       |   18 ++++++++++++------
 fcoemon_utils.h |   11 -----------
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/fcoemon.c b/fcoemon.c
index d0b493a..a751951 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1912,14 +1912,20 @@ int main(int argc, char **argv)
 	memset(&sig, 0, sizeof(sig));
 	sig.sa_handler = fcm_sig;
 	rc = sigaction(SIGINT, &sig, NULL);
-	if (rc < 0)
-		SA_LOG_ERR_EXIT(errno, "sigaction failed");
+	if (rc < 0) {
+		SA_LOG_ERR(errno, "sigaction failed");
+		exit(1);
+	}
 	rc = sigaction(SIGTERM, &sig, NULL);
-	if (rc < 0)
-		SA_LOG_ERR_EXIT(errno, "sigaction failed");
+	if (rc < 0) {
+		SA_LOG_ERR(errno, "sigaction failed");
+		exit(1);
+	}
 	rc = sigaction(SIGHUP, &sig, NULL);
-	if (rc < 0)
-		SA_LOG_ERR_EXIT(errno, "sigaction failed");
+	if (rc < 0) {
+		SA_LOG_ERR(errno, "sigaction failed");
+		exit(1);
+	}
 	fcm_pidfile_create();
 	fcm_fcoe_init();
 	fcm_link_init();	/* NETLINK_ROUTE protocol */
diff --git a/fcoemon_utils.h b/fcoemon_utils.h
index baf7b9c..cab02eb 100644
--- a/fcoemon_utils.h
+++ b/fcoemon_utils.h
@@ -66,17 +66,6 @@ void sa_log_abort(const char *);	/* log message and abort */
 	} while (0)
 
 /*
- * Logging exits.
- */
-#define SA_LOG_ERR_EXIT(error, ...) \
-	do {								\
-		sa_log_func(__func__, __VA_ARGS__);			\
-		sa_log_err(error, __func__, "exiting at %s:%d",		\
-			__FILE__, __LINE__);				\
-		exit(1);						\
-	} while (0)
-
-/*
  * Logging options.
  */
 #define SA_LOGF_TIME    0x0001      /* include timestamp in message */




More information about the devel mailing list