aboutsummaryrefslogtreecommitdiff
path: root/src/extern.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-09-19 00:37:43 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-09-19 03:14:47 +0300
commit1f6b4122815eb16dca584faac123ef46da2d538f (patch)
tree9934c37a74ed0f4ac5248eac345b971a6882d8fb /src/extern.h
parenta279052b65a53d228f0d2cd188114f4cf398cc82 (diff)
downloadcpio-1f6b4122815eb16dca584faac123ef46da2d538f.tar.gz
cpio-1f6b4122815eb16dca584faac123ef46da2d538f.tar.bz2
Fix error handling in disk_empty_output_buffer and sparse_write
* src/extern.h (delayed_seek_count): Remove. (disk_empty_output_buffer): Change signature. * src/util.c (disk_empty_output_buffer): Take two arguments. Correctly handle partial writes (errno is not meaningful). (delayed_seek_count): Remove variable. (sparse_write): Change return type and signature. Rewrite. Return number actual number of bytes written or -1 on error. Check returns from lseek and write. * src/copyin.c (copyin_regular_file): Call disk_empty_output_buffer with flush=true before closing the file. * src/copypass.c (process_copy_pass): Likewise.
Diffstat (limited to 'src/extern.h')
-rw-r--r--src/extern.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/extern.h b/src/extern.h
index c25a6ef..be329ae 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -76,7 +76,6 @@ extern int archive_des;
extern char *archive_name;
extern char *rsh_command_option;
extern unsigned long crc;
-extern int delayed_seek_count;
#ifdef DEBUG_CPIO
extern int debug_flag;
#endif
@@ -157,7 +156,7 @@ char *parse_user_spec (char *name, uid_t *uid, gid_t *gid,
/* util.c */
void tape_empty_output_buffer (int out_des);
-void disk_empty_output_buffer (int out_des);
+void disk_empty_output_buffer (int out_des, bool flush);
void swahw_array (char *ptr, int count);
void tape_buffered_write (char *in_buf, int out_des, off_t num_bytes);
void tape_buffered_read (char *in_buf, int in_des, off_t num_bytes);

Return to:

Send suggestions and report system problems to the System administrator.