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 <[email protected]>
---

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

diff --git a/fcoemon.c b/fcoemon.c
index 0e278a4..c5fc4ca 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -2087,14 +2087,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 */

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to