diff options
author | Geert Hauwaerts <geert@hauwaerts.be> | 2014-07-06 23:21:23 +0200 |
---|---|---|
committer | Geert Hauwaerts <geert@hauwaerts.be> | 2014-07-06 23:21:23 +0200 |
commit | 43baf71efd8d7323a2d6ae939c3c6350fef70f72 (patch) | |
tree | bc8bcb5f3aebbafae84cf164aa3dbef9d36b81b8 /src/core | |
parent | 4c6ba664c4e041a4295c7cb5ed77801a84fc7557 (diff) | |
parent | b03b65e0294f5802c9bbe8ddf8446f09b3ba366a (diff) | |
download | irssi-43baf71efd8d7323a2d6ae939c3c6350fef70f72.zip |
Merge branch 'master' of https://github.com/irssi/irssi
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commands.c | 4 | ||||
-rw-r--r-- | src/core/network.c | 6 | ||||
-rw-r--r-- | src/core/rawlog.c | 11 | ||||
-rw-r--r-- | src/core/write-buffer.c | 4 |
4 files changed, 19 insertions, 6 deletions
diff --git a/src/core/commands.c b/src/core/commands.c index 547f7b16..ed82f44e 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -968,7 +968,9 @@ static void cmd_cd(const char *data) if (*data == '\0') return; str = convert_home(data); - chdir(str); + if (chdir(str) != 0) { + g_warning("Failed to chdir(): %s", strerror(errno)); + } g_free(str); } diff --git a/src/core/network.c b/src/core/network.c index 7e55d472..3659ab36 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -60,7 +60,11 @@ GIOChannel *g_io_channel_new(int handle) IPADDR ip4_any = { AF_INET, - { { { INADDR_ANY } } } +#if defined(HAVE_IPV6) && defined(IN6ADDR_ANY_INIT) + IN6ADDR_ANY_INIT +#else + { INADDR_ANY } +#endif }; int net_ip_compare(IPADDR *ip1, IPADDR *ip2) diff --git a/src/core/rawlog.c b/src/core/rawlog.c index 20368aeb..e66f20dd 100644 --- a/src/core/rawlog.c +++ b/src/core/rawlog.c @@ -102,10 +102,15 @@ void rawlog_redirect(RAWLOG_REC *rawlog, const char *str) static void rawlog_dump(RAWLOG_REC *rawlog, int f) { GSList *tmp; + ssize_t ret = 1; - for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) { - write(f, tmp->data, strlen((char *) tmp->data)); - write(f, "\n", 1); + for (tmp = rawlog->lines; ret && tmp != NULL; tmp = tmp->next) { + ret = write(f, tmp->data, strlen((char *) tmp->data)); + ret &= write(f, "\n", 1); + } + + if (ret <= 0) { + g_warning("rawlog write() failed: %s", strerror(errno)); } } diff --git a/src/core/write-buffer.c b/src/core/write-buffer.c index 6f6eef8a..ffc3ae63 100644 --- a/src/core/write-buffer.c +++ b/src/core/write-buffer.c @@ -107,7 +107,9 @@ static int write_buffer_flush_rec(void *handlep, BUFFER_REC *rec) for (tmp = rec->blocks; tmp != NULL; tmp = tmp->next) { size = tmp->data != rec->active_block ? BUFFER_BLOCK_SIZE : rec->active_block_pos; - write(handle, tmp->data, size); + if (write(handle, tmp->data, size) != size) { + g_warning("Failed to write(): %s", strerror(errno)); + } } empty_blocks = g_slist_concat(empty_blocks, rec->blocks); |