diff --git a/awesome-client.c b/awesome-client.c index a09ef00e..fa1a7f88 100644 --- a/awesome-client.c +++ b/awesome-client.c @@ -52,10 +52,10 @@ send_msg(char *msg, ssize_t msg_len) switch (errno) { case ENOENT: - warn("Can't write to %s\n", addr->sun_path); + warn("can't write to %s\n", addr->sun_path); break; default: - perror("error sending datagram"); + warn("error sending datagram: %s\n", strerror(errno)); } ret_value = errno; } diff --git a/awesome-menu.c b/awesome-menu.c index f4254101..09ffe7a7 100644 --- a/awesome-menu.c +++ b/awesome-menu.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -138,10 +139,10 @@ config_parse(int screen, const char *confpatharg, switch((ret = cfg_parse(cfg, confpath))) { case CFG_FILE_ERROR: - perror("awesome-message: parsing configuration file failed"); + warn("parsing configuration file failed: %s\n", strerror(errno)); break; case CFG_PARSE_ERROR: - cfg_error(cfg, "awesome: parsing configuration file %s failed.\n", confpath); + cfg_error(cfg, "W: awesome: parsing configuration file %s failed.\n", confpath); break; } diff --git a/awesome-message.c b/awesome-message.c index 99bc9437..106a2ea9 100644 --- a/awesome-message.c +++ b/awesome-message.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -78,7 +79,7 @@ config_parse(int screen, const char *confpatharg) switch((ret = cfg_parse(cfg, confpath))) { case CFG_FILE_ERROR: - perror("awesome-message: parsing configuration file failed"); + warn("parsing configuration file failed: %s\n", strerror(errno)); break; case CFG_PARSE_ERROR: cfg_error(cfg, "awesome: parsing configuration file %s failed.\n", confpath); diff --git a/awesome.c b/awesome.c index cb6ea427..b53f6769 100644 --- a/awesome.c +++ b/awesome.c @@ -394,7 +394,7 @@ main(int argc, char *argv[]) switch (r = recv(csfd, buf, sizeof(buf)-1, MSG_TRUNC)) { case -1: - perror("awesome: error reading UNIX domain socket"); + warn("error reading UNIX domain socket: %s\n", strerror(errno)); csfd = -1; break; case 0: @@ -436,9 +436,9 @@ main(int argc, char *argv[]) if(csfd > 0 && close(csfd)) - perror("error closing UNIX domain socket"); + warn("error closing UNIX domain socket: %s\n", strerror(errno)); if(unlink(addr->sun_path)) - perror("error unlinking UNIX domain socket"); + warn("error unlinking UNIX domain socket: %s\n", strerror(errno)); p_delete(&addr); /* remap all clients since some WM won't handle them otherwise */ diff --git a/common/configopts.c b/common/configopts.c index 9237bf18..33700f36 100644 --- a/common/configopts.c +++ b/common/configopts.c @@ -539,7 +539,7 @@ config_check(const char *confpatharg) switch((ret = cfg_parse(cfg, confpath))) { case CFG_FILE_ERROR: - perror("awesome: parsing configuration file failed"); + warn("parsing configuration file failed: %s\n", strerror(errno)); break; case CFG_PARSE_ERROR: cfg_error(cfg, "awesome: parsing configuration file %s failed.\n", confpath); diff --git a/common/draw.c b/common/draw.c index 5c58134c..10e5e52f 100644 --- a/common/draw.c +++ b/common/draw.c @@ -55,7 +55,7 @@ draw_iso2utf8(char *iso) warn("unable to convert text from %s to UTF-8, not available", nl_langinfo(CODESET)); else - perror("awesome: unable to convert text"); + warn("unable to convert text: %s\n", strerror(errno)); return NULL; } @@ -65,7 +65,7 @@ draw_iso2utf8(char *iso) if(iconv(iso2utf8, &iso, &len, &utf8, &utf8len) == (size_t) -1) { - perror("awesome: text conversion failed"); + warn("text conversion failed: %s\n", strerror(errno)); p_delete(&utf8p); return NULL; } diff --git a/common/socket.c b/common/socket.c index c171f2f8..f3652bb4 100644 --- a/common/socket.c +++ b/common/socket.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -88,7 +89,7 @@ get_client_socket(void) csfd = socket(AF_UNIX, SOCK_DGRAM, 0); if(csfd < 0) - perror("error opening UNIX domain socket"); + warn("error opening UNIX domain socket: %s\n", strerror(errno)); return csfd; } diff --git a/config.c b/config.c index 61f51f18..3ea31f5a 100644 --- a/config.c +++ b/config.c @@ -19,6 +19,7 @@ * */ +#include #include #include "config.h" @@ -479,12 +480,12 @@ config_parse(const char *confpatharg) switch(ret) { case CFG_FILE_ERROR: - perror("awesome: parsing configuration file failed"); + warn("parsing configuration file failed: %s\n", strerror(errno)); if(!(defconfig = fopen(confpath, "w"))) - perror("awesome: unable to create default configuration file"); + warn("unable to create default configuration file: %s\n", strerror(errno)); break; case CFG_PARSE_ERROR: - cfg_error(cfg, "awesome: parsing configuration file %s failed.\n", confpath); + cfg_error(cfg, "W: awesome: parsing configuration file %s failed.\n", confpath); break; } diff --git a/uicb.c b/uicb.c index 74b33f75..bc1d023b 100644 --- a/uicb.c +++ b/uicb.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "awesome.h" #include "tag.h" @@ -117,8 +118,7 @@ uicb_spawn(int screen, char *arg) close(ConnectionNumber(globalconf.display)); setsid(); execl(shell, shell, "-c", arg, NULL); - warn("execl '%s -c %s'", shell, arg); - perror(" failed"); + warn("execl '%s -c %s' failed: %s\n", shell, arg, strerror(errno)); } exit(EXIT_SUCCESS); }