diff options
author | Frederik Carlier | 2017-10-29 22:04:17 +0100 |
---|---|---|
committer | Nikias Bassen | 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); #endif char *string_concat(const char *str, ...); -void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); -void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); +int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); +int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); enum plist_format_t { PLIST_FORMAT_XML, |