Richard W.M. Jones
fdfedcb4ef
Use 'error' function for fprintf followed by exit.
...
Like with the previous commit, this replaces instances of:
if (something_bad) {
fprintf (stderr, "%s: error message\n", guestfs_int_program_name);
exit (EXIT_FAILURE);
}
with:
if (something_bad)
error (EXIT_FAILURE, 0, "error message");
(except in a few cases were errno was incorrectly being ignored, in
which case I have fixed that).
It's slightly more complex than the previous commit because we must be
careful to:
- Remove the program name (since error(3) prints it).
- Remove any trailing \n character from the message.
Candidates for replacement were found using:
pcregrep --buffer-size 10M -M '\bfprintf\b.*\n.*\bexit\b' `git ls-files`
2016-04-04 17:57:38 +01:00
..
2016-01-02 21:19:51 +00:00
2014-12-02 08:37:46 +00:00
2016-04-04 17:57:38 +01:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2013-12-18 15:15:53 +00:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2016-04-04 13:14:26 +01:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2016-04-04 17:57:38 +01:00
2013-04-02 12:38:50 +01:00
2016-03-07 17:36:24 +00:00
2016-02-03 13:15:29 +01:00
2016-01-02 21:19:51 +00:00
2016-03-07 17:36:24 +00:00
2016-04-04 17:57:38 +01:00
2013-02-11 13:21:51 +00:00
2016-01-02 21:19:51 +00:00
2013-10-17 15:23:40 +01:00
2016-01-02 21:19:51 +00:00
2016-03-16 15:16:39 +00:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2016-04-04 17:57:38 +01:00
2016-04-04 13:14:26 +01:00
2016-04-04 13:14:26 +01:00
2016-01-02 21:19:51 +00:00
2016-04-04 13:14:26 +01:00
2016-04-04 13:14:26 +01:00
2016-01-02 21:19:51 +00:00
2016-04-04 17:57:38 +01:00
2013-02-08 16:15:25 +00:00
2012-01-18 22:05:02 +00:00
2016-04-04 17:57:38 +01:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2016-01-02 21:19:51 +00:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2015-12-18 17:10:25 +01:00
2014-09-17 17:31:50 +01:00
2015-10-30 16:07:32 +00:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2015-11-05 13:48:38 +00:00
2015-11-05 13:48:38 +00:00
2015-11-05 13:48:38 +00:00
2014-09-17 17:31:50 +01:00
2015-12-15 17:01:44 +00:00
2014-09-17 17:31:50 +01:00
2016-01-02 21:19:51 +00:00
2014-09-17 17:31:50 +01:00
2015-11-05 13:48:38 +00:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2015-12-15 17:01:44 +00:00
2014-09-17 17:31:50 +01:00
2014-09-17 17:31:50 +01:00
2015-10-30 16:07:32 +00:00
2016-04-04 13:14:26 +01:00
2016-01-02 21:19:51 +00:00
2015-10-05 14:28:33 +01:00
2014-05-07 15:06:51 +02:00
2016-02-26 10:45:21 +00:00
2016-01-11 13:42:49 +00:00
2016-02-26 10:45:21 +00:00
2014-03-20 13:47:19 +00:00
2016-02-26 10:45:21 +00:00
2016-01-11 13:42:49 +00:00
2016-02-26 10:45:21 +00:00
2014-03-20 13:47:19 +00:00
2016-04-04 17:57:38 +01:00
2016-01-02 21:19:51 +00:00