mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
error log: keep more calloc and its error messages match
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
committed by
Richard W.M. Jones
parent
6118e2239c
commit
3ae5f72743
@@ -191,7 +191,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -205,7 +205,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
4
cat/ls.c
4
cat/ls.c
@@ -293,7 +293,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -307,7 +307,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
@@ -394,7 +394,7 @@ parse_md_stat_line (char *line)
|
||||
ret->guestfs_int_mdstat_list_val =
|
||||
calloc (spaces+1, sizeof (struct guestfs_int_mdstat));
|
||||
if (ret->guestfs_int_mdstat_list_val == NULL) {
|
||||
reply_with_perror ("malloc");
|
||||
reply_with_perror ("calloc");
|
||||
free (ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ do_internal_lstatnslist (const char *path, char *const *names)
|
||||
ret->guestfs_int_statns_list_val =
|
||||
calloc (nr_names, sizeof (guestfs_int_statns));
|
||||
if (ret->guestfs_int_statns_list_val == NULL) {
|
||||
reply_with_perror ("malloc");
|
||||
reply_with_perror ("calloc");
|
||||
free (ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ getxattrs (const char *path,
|
||||
|
||||
r = calloc (1, sizeof (*r));
|
||||
if (r == NULL) {
|
||||
reply_with_perror ("malloc");
|
||||
reply_with_perror ("calloc");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -231,7 +231,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
@@ -226,7 +226,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
@@ -361,7 +361,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_N;
|
||||
@@ -449,7 +449,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -463,7 +463,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
@@ -38,7 +38,7 @@ option_a (const char *arg, const char *format, struct drv **drvsp)
|
||||
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ option_d (const char *arg, struct drv **drvsp)
|
||||
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
|
||||
@@ -253,7 +253,7 @@ main (int argc, char *argv[])
|
||||
access (argv[optind], F_OK) == 0) { /* simulate -a option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_a;
|
||||
@@ -267,7 +267,7 @@ main (int argc, char *argv[])
|
||||
} else { /* simulate -d option */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_d;
|
||||
@@ -530,7 +530,7 @@ add_scratch_disk (struct drv **drvs)
|
||||
/* Add the scratch disk to the drives list. */
|
||||
drv = calloc (1, sizeof (struct drv));
|
||||
if (!drv) {
|
||||
perror ("malloc");
|
||||
perror ("calloc");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
drv->type = drv_scratch;
|
||||
|
||||
Reference in New Issue
Block a user