Implemented the use of %m as a shortcut for %s and strerror(errno) in all syslog...
authorArt Cancro <ajc@citadel.org>
Wed, 24 May 2017 20:58:20 +0000 (16:58 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 24 May 2017 20:58:20 +0000 (16:58 -0400)
citadel/citserver.c
citadel/clientsocket.c
citadel/context.c
citadel/database.c
citadel/ldap.c
citadel/msgbase.c
citadel/server_main.c
citadel/sysdep.c
citadel/threads.c
citadel/user_ops.c

index 59dc31443f72ec494c2be44c38c4b51a21264402..babade1fb1d1b513e75132d8f12d85addf785195 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Main source module for the Citadel server
  *
- * Copyright (c) 1987-2015 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
@@ -176,9 +176,9 @@ void master_startup(void) {
        urandom = fopen("/dev/urandom", "r");
        if (urandom != NULL) {
                rv = fread(&seed, sizeof seed, 1, urandom);
-               if (rv == -1)
-                       syslog(LOG_EMERG, "failed to read random seed: %s\n", 
-                              strerror(errno));
+               if (rv == -1) {
+                       syslog(LOG_ERR, "citserver: failed to read random seed: %m");
+               }
                fclose(urandom);
        }
        else {
index 1abf2d89e25ba17ff4fc1e4dea662387a194465d..b28d2000bce86b1babd276603a2248d5a9451917 100644 (file)
@@ -4,7 +4,7 @@
  * sockets for the Citadel client; for that you must look in ipc_c_tcp.c
  * (which, uncoincidentally, bears a striking similarity to this file).
  *
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2017 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
@@ -71,7 +71,7 @@ int sock_connect(char *host, char *service)
        for (ai = res; ai != NULL; ai = ai->ai_next) {
                sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
                if (sock < 0) {
-                       syslog(LOG_ERR, "%s: %s", host, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", host);
                        freeaddrinfo(res);
                        return(-1);
                }
@@ -81,7 +81,7 @@ int sock_connect(char *host, char *service)
                        return(sock);
                }
                else {
-                       syslog(LOG_ERR, "%s: %s", host, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", host);
                        close(sock);
                }
        }
@@ -192,7 +192,6 @@ int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout)
                        FD_ZERO(&rfds);
                        FD_SET(*sock, &rfds);
                        if (select(*sock + 1, NULL, &rfds, NULL, &tv) == -1) {
-///                            *Error = strerror(errno);
                                close (*sock);
                                *sock = -1;
                                return -1;
@@ -217,7 +216,6 @@ int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout)
                        FD_ZERO(&rfds);
                        FD_SET(*sock, &rfds);
                        if (select(*sock + 1, NULL, &rfds, NULL, &tv) == -1) {
-///                            *Error = strerror(errno);
                                close (*sock);
                                *sock = -1;
                                return -1;
index 4e8594d785d4dbbcc83cfe66de4beeacfeab48bb..f95a7a2f7cab24e9a867aa92f4f95b6f993c6e72 100644 (file)
@@ -347,7 +347,7 @@ CitContext *CreateNewContext(void) {
 
        me = (CitContext *) malloc(sizeof(CitContext));
        if (me == NULL) {
-               syslog(LOG_ERR, "citserver: malloc() failed: %s", strerror(errno));
+               syslog(LOG_ERR, "citserver: malloc() failed: %m");
                return NULL;
        }
        memset(me, 0, sizeof(CitContext));
@@ -396,7 +396,7 @@ CitContext *CloneContext(CitContext *CloneMe) {
 
        me = (CitContext *) malloc(sizeof(CitContext));
        if (me == NULL) {
-               syslog(LOG_ERR, "citserver: malloc() failed: %s", strerror(errno));
+               syslog(LOG_ERR, "citserver: malloc() failed: %m");
                return NULL;
        }
        memcpy(me, CloneMe, sizeof(CitContext));
index 870d08bb78545ae8167e500e8d11ce08f80992c5..fcb82d2e5eecadbb6a155edfc258f4aac42a701a 100644 (file)
@@ -263,13 +263,13 @@ void open_databases(void)
         * already there, no problem.
         */
        if ((mkdir(ctdl_data_dir, 0700) != 0) && (errno != EEXIST)){
-               syslog(LOG_ERR, "db: unable to create database directory [%s]: %s", ctdl_data_dir, strerror(errno));
+               syslog(LOG_ERR, "db: unable to create database directory [%s]: %m", ctdl_data_dir);
        }
        if (chmod(ctdl_data_dir, 0700) != 0){
-               syslog(LOG_ERR, "db: unable to set database directory accessrights [%s]: %s", ctdl_data_dir, strerror(errno));
+               syslog(LOG_ERR, "db: unable to set database directory accessrights [%s]: %m", ctdl_data_dir);
        }
        if (chown(ctdl_data_dir, CTDLUID, (-1)) != 0){
-               syslog(LOG_ERR, "db: unable to set the owner for [%s]: %s", ctdl_data_dir, strerror(errno));
+               syslog(LOG_ERR, "db: unable to set the owner for [%s]: %m", ctdl_data_dir);
        }
        syslog(LOG_DEBUG, "db: Setting up DB environment\n");
        /* db_env_set_func_yield((int (*)(u_long,  u_long))sched_yield); */
index 2d3140849011f61978d433d8cdb412baa484f91b..d5f5d41ce11e5a9aa66d096edee7b17f007c616b 100644 (file)
@@ -40,7 +40,7 @@ int ctdl_ldap_initialize(LDAP **ld) {
        snprintf(server_url, sizeof server_url, "ldap://%s:%d", CtdlGetConfigStr("c_ldap_host"), CtdlGetConfigInt("c_ldap_port"));
        ret = ldap_initialize(ld, server_url);
        if (ret != LDAP_SUCCESS) {
-               syslog(LOG_ERR, "ldap: could not connect to %s : %s", server_url, strerror(errno));
+               syslog(LOG_ERR, "ldap: could not connect to %s : %m", server_url);
                *ld = NULL;
                return(errno);
        }
index bd58be4bde4a80e11317ba02f2b104ea15b14a83..a4ef8b925cfd6fea7b820b25e14b4cde8d242af9 100644 (file)
@@ -1045,14 +1045,14 @@ void mime_download(char *name, char *filename, char *partnum, char *disp,
        ) {
                CC->download_fp = tmpfile();
                if (CC->download_fp == NULL) {
-                       syslog(LOG_EMERG, "msgbase: mime_download() couldn't write: %s", strerror(errno));
+                       syslog(LOG_EMERG, "msgbase: mime_download() couldn't write: %m");
                        cprintf("%d cannot open temporary file: %s\n", ERROR + INTERNAL_ERROR, strerror(errno));
                        return;
                }
        
                rv = fwrite(content, length, 1, CC->download_fp);
                if (rv <= 0) {
-                       syslog(LOG_EMERG, "msgbase: mime_download() Couldn't write: %s", strerror(errno));
+                       syslog(LOG_EMERG, "msgbase: mime_download() Couldn't write: %m");
                        cprintf("%d unable to write tempfile.\n", ERROR + TOO_BIG);
                        fclose(CC->download_fp);
                        CC->download_fp = NULL;
@@ -2639,9 +2639,7 @@ void CtdlSerializeMessage(struct ser_ret *ret,            /* return values */
 
        ret->ser = malloc(ret->len);
        if (ret->ser == NULL) {
-               syslog(LOG_ERR, "msgbase: CtdlSerializeMessage() malloc(%ld) failed: %s",
-                          (long)ret->len, strerror(errno)
-               );
+               syslog(LOG_ERR, "msgbase: CtdlSerializeMessage() malloc(%ld) failed: %m", (long)ret->len);
                ret->len = 0;
                ret->ser = NULL;
                return;
@@ -3592,7 +3590,7 @@ void AdjRefCount(long msgnum, int incr)
        new_arcq.arcq_delta = incr;
        rv = fwrite(&new_arcq, sizeof(struct arcq), 1, arcfp);
        if (rv == -1) {
-               syslog(LOG_EMERG, "%s: %s", file_arcq, strerror(errno));
+               syslog(LOG_EMERG, "%s: %m", file_arcq);
        }
        fflush(arcfp);
 
@@ -3636,7 +3634,7 @@ void AdjRefCountList(long *msgnum, long nmsg, int incr)
        {
                rv = fwrite(new_arcq + offset, 1, the_size - offset, arcfp);
                if (rv == -1) {
-                       syslog(LOG_EMERG, "%s: %s", file_arcq, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", file_arcq);
                }
                else {
                        offset += rv;
@@ -3674,7 +3672,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
 
        r = link(file_arcq, file_arcq_temp);
        if (r != 0) {
-               syslog(LOG_ERR, "%s: %s", file_arcq_temp, strerror(errno));
+               syslog(LOG_ERR, "%s: %m", file_arcq_temp);
                end_critical_section(S_SUPPMSGMAIN);
                return(num_records_processed);
        }
@@ -3684,7 +3682,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
 
        fp = fopen(file_arcq_temp, "rb");
        if (fp == NULL) {
-               syslog(LOG_ERR, "%s: %s", file_arcq_temp, strerror(errno));
+               syslog(LOG_ERR, "%s: %m", file_arcq_temp);
                return(num_records_processed);
        }
 
@@ -3696,7 +3694,7 @@ int TDAP_ProcessAdjRefCountQueue(void)
        fclose(fp);
        r = unlink(file_arcq_temp);
        if (r != 0) {
-               syslog(LOG_ERR, "%s: %s", file_arcq_temp, strerror(errno));
+               syslog(LOG_ERR, "%s: %m", file_arcq_temp);
        }
 
        return(num_records_processed);
index da2ec758621b0e3b9f733451eb4f54370442bf82..b02596f3f4e2dda3866e497f7dc989abad864aa6 100644 (file)
@@ -48,7 +48,7 @@ void ctdl_lockfile(int yo) {
                snprintf(lockfilename, sizeof lockfilename, "%s/citadel.lock", ctdl_run_dir);
                fp = fopen(lockfilename, "w");
                if (!fp) {
-                       syslog(LOG_ERR, "%s: %s", lockfilename, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", lockfilename);
                        exit(CTDLEXIT_DB);
                }
                if (flock(fileno(fp), (LOCK_EX|LOCK_NB)) != 0) {
@@ -230,11 +230,11 @@ int main(int argc, char **argv)
 #endif // HAVE_GETPWUID_R
 
                if ((mkdir(ctdl_run_dir, 0755) != 0) && (errno != EEXIST)) {
-                       syslog(LOG_ERR, "main: unable to create run directory [%s]: %s", ctdl_run_dir, strerror(errno));
+                       syslog(LOG_ERR, "main: unable to create run directory [%s]: %m", ctdl_run_dir);
                }
 
                if (chown(ctdl_run_dir, ctdluid, (pwp==NULL)?-1:pw.pw_gid) != 0) {
-                       syslog(LOG_ERR, "main: unable to set the access rights for [%s]: %s", ctdl_run_dir, strerror(errno));
+                       syslog(LOG_ERR, "main: unable to set the access rights for [%s]: %m", ctdl_run_dir);
                }
        }
 #endif
@@ -345,15 +345,15 @@ int main(int argc, char **argv)
 #endif // HAVE_GETPWUID_R
 
                if (pwp == NULL)
-                       syslog(LOG_ERR, "main: WARNING, getpwuid(%ld): %s" "Group IDs will be incorrect.", (long)CTDLUID, strerror(errno));
+                       syslog(LOG_ERR, "main: WARNING, getpwuid(%ld): %m Group IDs will be incorrect.", (long)CTDLUID);
                else {
                        initgroups(pw.pw_name, pw.pw_gid);
                        if (setgid(pw.pw_gid))
-                               syslog(LOG_ERR, "main: setgid(%ld): %s", (long)pw.pw_gid, strerror(errno));
+                               syslog(LOG_ERR, "main: setgid(%ld): %m", (long)pw.pw_gid);
                }
                syslog(LOG_INFO, "main: changing uid to %ld", (long)CTDLUID);
                if (setuid(CTDLUID) != 0) {
-                       syslog(LOG_ERR, "main: setuid() failed: %s", strerror(errno));
+                       syslog(LOG_ERR, "main: setuid() failed: %m");
                }
 #if defined (HAVE_SYS_PRCTL_H) && defined (PR_SET_DUMPABLE)
                prctl(PR_SET_DUMPABLE, 1);
index d36a39517185c0bb03124ade6db43f1f9fb31cfd..cbed531f43498ee2d63a8b416632882a57671d80 100644 (file)
@@ -91,7 +91,7 @@ void init_sysdep(void) {
         * session to which the calling thread is currently bound.
         */
        if (pthread_key_create(&MyConKey, NULL) != 0) {
-               syslog(LOG_CRIT, "sysdep: can't create TSD key: %s", strerror(errno));
+               syslog(LOG_CRIT, "sysdep: can't create TSD key: %m");
        }
 
        /*
@@ -164,9 +164,7 @@ int ctdl_tcp_server(char *ip_addr, int port_number, int queue_len, char *errorme
        {
                ip_version = 6;
                if (inet_pton(AF_INET6, ip_addr, &sin6.sin6_addr) <= 0) {
-                       snprintf(errormessage, SIZ,
-                                "Error binding to [%s] : %s", ip_addr, strerror(errno)
-                       );
+                       snprintf(errormessage, SIZ, "Error binding to [%s] : %s", ip_addr, strerror(errno));
                        syslog(LOG_ALERT, "tcpserver: %s", errormessage);
                        return (-1);
                }
@@ -235,7 +233,7 @@ int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage)
        i = unlink(sockpath);
        if ((i != 0) && (errno != ENOENT)) {
                snprintf(errormessage, SIZ, "can't unlink %s: %s", sockpath, strerror(errno));
-               syslog(LOG_EMERG, "udsserver: %s", errormessage);
+               syslog(LOG_ERR, "udsserver: %s", errormessage);
                return(-1);
        }
 
@@ -246,27 +244,27 @@ int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage)
        s = socket(AF_UNIX, SOCK_STREAM, 0);
        if (s < 0) {
                snprintf(errormessage, SIZ, "can't create a socket: %s", strerror(errno));
-               syslog(LOG_EMERG, "udsserver: %s", errormessage);
+               syslog(LOG_ERR, "udsserver: %s", errormessage);
                return(-1);
        }
 
        if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
                snprintf(errormessage, SIZ, "can't bind: %s", strerror(errno));
-               syslog(LOG_EMERG, "udsserver: %s", errormessage);
+               syslog(LOG_ERR, "udsserver: %s", errormessage);
                return(-1);
        }
 
        /* set to nonblock - we need this for some obscure situations */
        if (fcntl(s, F_SETFL, O_NONBLOCK) < 0) {
                snprintf(errormessage, SIZ, "can't set socket to non-blocking: %s", strerror(errno));
-               syslog(LOG_EMERG, "udsserver: %s", errormessage);
+               syslog(LOG_ERR, "udsserver: %s", errormessage);
                close(s);
                return(-1);
        }
 
        if (listen(s, actual_queue_len) < 0) {
                snprintf(errormessage, SIZ, "can't listen: %s", strerror(errno));
-               syslog(LOG_EMERG, "udsserver: %s", errormessage);
+               syslog(LOG_ERR, "udsserver: %s", errormessage);
                return(-1);
        }
 
@@ -376,7 +374,7 @@ int client_write(const char *buf, int nbytes)
                
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -419,11 +417,7 @@ int client_write(const char *buf, int nbytes)
                                                continue;
                                        }
                                } else {
-                                       syslog(LOG_ERR,
-                                               "sysdep: client_write(%d bytes) select failed: %s (%d)",
-                                               nbytes - bytes_written,
-                                               strerror(errno), errno
-                                       );
+                                       syslog(LOG_ERR, "sysdep: client_write(%d bytes) select failed: %m", nbytes - bytes_written);
                                        cit_backtrace();
                                        client_close();
                                        Ctx->kill_me = KILLME_SELECT_FAILED;
@@ -434,11 +428,7 @@ int client_write(const char *buf, int nbytes)
 
                retval = write(Ctx->client_socket, &buf[bytes_written], nbytes - bytes_written);
                if (retval < 1) {
-                       syslog(LOG_ERR,
-                               "sysdep: client_write(%d bytes) failed: %s (%d)",
-                               nbytes - bytes_written,
-                               strerror(errno), errno
-                       );
+                       syslog(LOG_ERR, "sysdep: client_write(%d bytes) failed: %m", nbytes - bytes_written);
                        cit_backtrace();
                        client_close();
                        Ctx->kill_me = KILLME_WRITE_FAILED;
@@ -500,7 +490,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
                        
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -520,7 +510,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
                
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -542,7 +532,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
                        
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -571,7 +561,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
                
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -630,7 +620,7 @@ int client_read_random_blob(StrBuf *Target, int timeout)
                        
                                fd = fopen(fn, "a+");
                                if (fd == NULL) {
-                                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                                       syslog(LOG_ERR, "%s: %m", fn);
                                        cit_backtrace();
                                        exit(1);
                                }
@@ -715,7 +705,7 @@ int CtdlClientGetLine(StrBuf *Target)
 
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -773,7 +763,7 @@ int CtdlClientGetLine(StrBuf *Target)
 
                fd = fopen(fn, "a+");
                if (fd == NULL) {
-                       syslog(LOG_ERR, "%s: %s", fn, strerror(errno));
+                       syslog(LOG_ERR, "%s: %m", fn);
                        cit_backtrace();
                        exit(1);
                }
@@ -984,7 +974,7 @@ void start_daemon(int unused) {
         * to be reused for other files.
         */
        if (chdir(ctdl_run_dir) != 0) {
-               syslog(LOG_ERR, "%s: %s", ctdl_run_dir, strerror(errno));
+               syslog(LOG_ERR, "%s: %m", ctdl_run_dir);
        }
 
        child = fork();
@@ -1002,7 +992,7 @@ void start_daemon(int unused) {
                (freopen("/dev/null", "w", stdout) != stdout) || 
                (freopen("/dev/null", "w", stderr) != stderr)
        ) {
-               syslog(LOG_ERR, "sysdep: unable to reopen stdio: %s", strerror(errno));
+               syslog(LOG_ERR, "sysdep: unable to reopen stdio: %m");
        }
 
        do {
@@ -1271,12 +1261,12 @@ do_select:      force_purge = 0;
                 */
                if (retval < 0) {
                        if (errno == EBADF) {
-                               syslog(LOG_ERR, "sysdep: select() failed: (%s)", strerror(errno));
+                               syslog(LOG_ERR, "sysdep: select() failed: %m");
                                HuntBadSession();
                                goto do_select;
                        }
                        if (errno != EINTR) {
-                               syslog(LOG_ERR, "sysdep: exiting (%s)", strerror(errno));
+                               syslog(LOG_ERR, "sysdep: exiting: %m");
                                server_shutting_down = 1;
                                continue;
                        } else {
@@ -1308,7 +1298,7 @@ do_select:        force_purge = 0;
                                         * operations barf on FreeBSD.  Not a fatal error.
                                         */
                                        if (fcntl(ssock, F_SETFL, 0) < 0) {
-                                               syslog(LOG_ERR, "sysdep: Can't set socket to blocking: %s", strerror(errno));
+                                               syslog(LOG_ERR, "sysdep: Can't set socket to blocking: %m");
                                        }
 
                                        /* New context will be created already
index 5773c8e3f82fd04235f3e77bcf59cfb1064bd9a6..9dd6b608ba142f83977719dda9ac6dd9e4e487eb 100644 (file)
@@ -138,7 +138,7 @@ void CtdlThreadCreate(void *(*start_routine)(void*))
        ret = pthread_attr_init(&attr);
        ret = pthread_attr_setstacksize(&attr, THREADSTACKSIZE);
        ret = pthread_create(&thread, &attr, CTC_backend, (void *)start_routine);
-       if (ret != 0) syslog(LOG_EMERG, "pthread_create() : %s", strerror(errno));
+       if (ret != 0) syslog(LOG_ERR, "pthread_create() : %m");
 }
 
 
@@ -156,7 +156,7 @@ int EVQShutDown = 0;
 void go_threading(void)
 {
        if (pthread_key_create(&ThreadKey, NULL) != 0) {
-               syslog(LOG_EMERG, "pthread_key_create() : %s", strerror(errno));
+               syslog(LOG_ERR, "pthread_key_create() : %m");
                abort();
        }
 
index 7cff90d024847cdfc1292efd8278707d7c2553d6..b78cc592fbdc84410569b7e242517707acbcc716 100644 (file)
@@ -771,19 +771,19 @@ static int validpw(uid_t uid, const char *pass)
        begin_critical_section(S_CHKPWD);
        rv = write(chkpwd_write_pipe[1], &uid, sizeof(uid_t));
        if (rv == -1) {
-               syslog(LOG_EMERG, "user_ops: communication with chkpwd broken: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: communication with chkpwd broken: %m");
                end_critical_section(S_CHKPWD);
                return 0;
        }
        rv = write(chkpwd_write_pipe[1], pass, 256);
        if (rv == -1) {
-               syslog(LOG_EMERG, "user_ops: communication with chkpwd broken: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: communication with chkpwd broken: %m");
                end_critical_section(S_CHKPWD);
                return 0;
        }
        rv = read(chkpwd_read_pipe[0], buf, 4);
        if (rv == -1) {
-               syslog(LOG_EMERG, "user_ops: ommunication with chkpwd broken: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: ommunication with chkpwd broken: %m");
                end_critical_section(S_CHKPWD);
                return 0;
        }
@@ -810,21 +810,21 @@ void start_chkpwd_daemon(void) {
        syslog(LOG_DEBUG, "user_ops: starting chkpwd daemon for host authentication mode");
 
        if ((stat(file_chkpwd, &filestats)==-1) || (filestats.st_size==0)) {
-               syslog(LOG_ERR, "user_ops: %s: %s", file_chkpwd, strerror(errno));
+               syslog(LOG_ERR, "user_ops: %s: %m", file_chkpwd);
                abort();
        }
        if (pipe(chkpwd_write_pipe) != 0) {
-               syslog(LOG_ERR, "user_ops: unable to create pipe for chkpwd daemon: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: unable to create pipe for chkpwd daemon: %m");
                abort();
        }
        if (pipe(chkpwd_read_pipe) != 0) {
-               syslog(LOG_ERR, "user_ops: unable to create pipe for chkpwd daemon: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: unable to create pipe for chkpwd daemon: %m");
                abort();
        }
 
        chkpwd_pid = fork();
        if (chkpwd_pid < 0) {
-               syslog(LOG_ERR, "user_ops: unable to fork chkpwd daemon: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: unable to fork chkpwd daemon: %m");
                abort();
        }
        if (chkpwd_pid == 0) {
@@ -832,7 +832,7 @@ void start_chkpwd_daemon(void) {
                dup2(chkpwd_read_pipe[1], 1);
                for (i=2; i<256; ++i) close(i);
                execl(file_chkpwd, file_chkpwd, NULL);
-               syslog(LOG_ERR, "user_ops: unable to exec chkpwd daemon: %s", strerror(errno));
+               syslog(LOG_ERR, "user_ops: unable to exec chkpwd daemon: %m");
                abort();
                exit(errno);
        }