diff options
| author | 2017-10-29 22:04:17 +0100 | |
|---|---|---|
| committer | 2017-10-29 22:04:17 +0100 | |
| commit | b6ec966d105e9f72d3a5a671afe526f54f3d327f (patch) | |
| tree | 9612ee0b02601413255d8f6c740f474e814eeb3f /src/utils.h | |
| parent | 8a5545de25d243955c68fb8d6c1bd9ef856b8e8a (diff) | |
| download | usbmuxd-b6ec966d105e9f72d3a5a671afe526f54f3d327f.tar.gz usbmuxd-b6ec966d105e9f72d3a5a671afe526f54f3d327f.tar.bz2 | |
Better error handling when saving pair records
plist_write_to_filename and buffer_write_to_filename now return 0 if the actual write operation failed (e.g. because access is denied to the file), and set errno if required.
Diffstat (limited to 'src/utils.h')
| -rw-r--r-- | src/utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils.h b/src/utils.h index 1137a93..b5cab3f 100644 --- a/src/utils.h +++ b/src/utils.h | |||
| @@ -75,8 +75,8 @@ char *stpcpy(char * s1, const char * s2); | |||
| 75 | #endif | 75 | #endif |
| 76 | char *string_concat(const char *str, ...); | 76 | char *string_concat(const char *str, ...); |
| 77 | 77 | ||
| 78 | void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); | 78 | int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); |
| 79 | void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); | 79 | int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); |
| 80 | 80 | ||
| 81 | enum plist_format_t { | 81 | enum plist_format_t { |
| 82 | PLIST_FORMAT_XML, | 82 | PLIST_FORMAT_XML, |
