mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Add more information to certain calls to perror.
Replace selected calls to 'perror (filename)' with: fprintf (stderr, "syscall: %s: %m\n", filename); so that more information is available about precisely which syscall failed. Note this is *not* reply_with_perror. These messages are only printed in verbose output, for the benefit of debugging.
This commit is contained in:
@@ -147,7 +147,7 @@ read_whole_file (const char *filename)
|
||||
*/
|
||||
ssize_t n = read (fd, r + size, alloc - size - 1);
|
||||
if (n == -1) {
|
||||
perror (filename);
|
||||
fprintf (stderr, "read: %s: %m\n", filename);
|
||||
free (r);
|
||||
close (fd);
|
||||
return NULL;
|
||||
@@ -158,7 +158,7 @@ read_whole_file (const char *filename)
|
||||
}
|
||||
|
||||
if (close (fd) == -1) {
|
||||
perror (filename);
|
||||
fprintf (stderr, "close: %s: %m\n", filename);
|
||||
free (r);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user