chiark / gitweb /
journal-remote: stop using EWOULDBLOCK
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 13 Mar 2015 12:51:55 +0000 (13:51 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Fri, 13 Mar 2015 13:10:35 +0000 (14:10 +0100)
There is no reason to ever use EWOULDBLOCK. It's equivalent to EAGAIN on
all architectures on linux.

src/journal-remote/journal-remote-parse.c
src/journal-remote/journal-remote.c

index 7e62954..e08cbcc 100644 (file)
@@ -112,7 +112,7 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
 
                 if (source->passive_fd)
                         /* we have to wait for some data to come to us */
-                        return -EWOULDBLOCK;
+                        return -EAGAIN;
 
                 if (source->size - source->filled < LINE_CHUNK &&
                     !realloc_buffer(source,
@@ -125,7 +125,7 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
                 n = read(source->fd, source->buf + source->filled,
                          source->size - source->filled);
                 if (n < 0) {
-                        if (errno != EAGAIN && errno != EWOULDBLOCK)
+                        if (errno != EAGAIN)
                                 log_error_errno(errno, "read(%d, ..., %zu): %m", source->fd,
                                                 source->size - source->filled);
                         return -errno;
@@ -178,7 +178,7 @@ static int fill_fixed_size(RemoteSource *source, void **data, size_t size) {
 
                 if (source->passive_fd)
                         /* we have to wait for some data to come to us */
-                        return -EWOULDBLOCK;
+                        return -EAGAIN;
 
                 if (!realloc_buffer(source, source->offset + size))
                         return log_oom();
@@ -186,7 +186,7 @@ static int fill_fixed_size(RemoteSource *source, void **data, size_t size) {
                 n = read(source->fd, source->buf + source->filled,
                          source->size - source->filled);
                 if (n < 0) {
-                        if (errno != EAGAIN && errno != EWOULDBLOCK)
+                        if (errno != EAGAIN)
                                 log_error_errno(errno, "read(%d, ..., %zu): %m", source->fd,
                                                 source->size - source->filled);
                         return -errno;
index 1a2c136..64498dd 100644 (file)
@@ -516,7 +516,7 @@ static int process_http_upload(
 
         while (true) {
                 r = process_source(source, arg_compress, arg_seal);
-                if (r == -EAGAIN || r == -EWOULDBLOCK)
+                if (r == -EAGAIN)
                         break;
                 else if (r < 0) {
                         log_warning("Failed to process data for connection %p", connection);
@@ -1034,7 +1034,7 @@ static int handle_raw_source(sd_event_source *event,
         } else if (r == -E2BIG) {
                 log_notice_errno(E2BIG, "Entry too big, skipped");
                 return 1;
-        } else if (r == -EAGAIN || r == -EWOULDBLOCK) {
+        } else if (r == -EAGAIN) {
                 return 0;
         } else if (r < 0) {
                 log_debug_errno(r, "Closing connection: %m");