diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2015-04-24 12:37:49 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2015-04-24 18:26:22 +0200 |
commit | cf30f8717a4ea56b79f4d382e3642779f104b24e (patch) | |
tree | 3a51e6e0c7f8cb112379fcb7a716d4cff1411383 /src/ostree/ot-builtin-cat.c | |
parent | 8ab2e60edcb0d7b32d3d2f7892914951acbb4fe7 (diff) | |
download | ostree-cf30f8717a4ea56b79f4d382e3642779f104b24e.tar.gz |
g_output_stream_splice: check correctly the error code
While at it, change the style of other two occurrences.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'src/ostree/ot-builtin-cat.c')
-rw-r--r-- | src/ostree/ot-builtin-cat.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ostree/ot-builtin-cat.c b/src/ostree/ot-builtin-cat.c index 721f992a..8eff545e 100644 --- a/src/ostree/ot-builtin-cat.c +++ b/src/ostree/ot-builtin-cat.c @@ -46,9 +46,12 @@ cat_one_file (GFile *f, if (!in) goto out; - if (!g_output_stream_splice (stdout_stream, in, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE, - cancellable, error)) - goto out; + { + gssize n_bytes_written = g_output_stream_splice (stdout_stream, in, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE, + cancellable, error); + if (n_bytes_written < 0) + goto out; + } ret = TRUE; out: |