@@ -20,7 +20,8 @@
#define DPRINTF(fmt, ...) \
do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
+do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); \
+ exit(EXIT_FAILURE); } while (0)
#else
#define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, ...) \
@@ -20,7 +20,8 @@
#define DPRINTF(fmt, ...) \
do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0)
#define BADF(fmt, ...) \
-do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
+do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); \
+ exit(EXIT_FAILURE); } while (0)
#else
#define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, ...) \
@@ -63,7 +63,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
if (kernel_size <= 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loader_params->kernel_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* load initrd */
@@ -78,7 +78,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
fprintf(stderr,
"qemu: memory too small for initial ram disk '%s'\n",
loader_params->initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
initrd_size = load_image_targphys(loader_params->initrd_filename,
initrd_offset,
@@ -87,7 +87,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
if (initrd_size == (target_ulong)-1) {
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
loader_params->initrd_filename);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
}
@@ -121,7 +121,7 @@ static void moxiesim_init(MachineState *machine)
cpu = cpu_moxie_init(cpu_model);
if (!cpu) {
fprintf(stderr, "Unable to find CPU definition\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
env = &cpu->env;
@@ -105,7 +105,7 @@ static void put_unused(QEMUFile *f, void *pv, size_t size)
{
fprintf(stderr, "uint16_from_uint8 is used only for backwards compatibility.\n");
fprintf(stderr, "Never should be used to write a new state.\n");
- exit(0);
+ exit(EXIT_SUCCESS);
}
static const VMStateInfo vmstate_hack_uint16_from_uint8 = {
@@ -807,7 +807,7 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
strcmp(s->files->f[index].name, s->files->f[i].name) == 0) {
error_report("duplicate fw_cfg file name: %s",
s->files->f[index].name);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
This patch is the result of coccinelle script scripts/coccinelle/exit.cocci Signed-off-by: Laurent Vivier <lvivier@redhat.com> --- hw/display/ssd0303.c | 3 ++- hw/i2c/smbus.c | 3 ++- hw/moxie/moxiesim.c | 8 ++++---- hw/nvram/eeprom93xx.c | 2 +- hw/nvram/fw_cfg.c | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-)