git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
guestfish: Redirect stdout when executing remote commands
[libguestfs.git]
/
fish
/
alloc.c
diff --git
a/fish/alloc.c
b/fish/alloc.c
index
8979acf
..
a7d115a
100644
(file)
--- a/
fish/alloc.c
+++ b/
fish/alloc.c
@@
-1,5
+1,5
@@
/* guestfish - the filesystem interactive shell
/* guestfish - the filesystem interactive shell
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-30,25
+30,25
@@
static int parse_size (const char *str, off_t *size_rtn);
int
static int parse_size (const char *str, off_t *size_rtn);
int
-do_alloc (int argc, char *argv[])
+do_alloc (
const char *cmd,
int argc, char *argv[])
{
off_t size;
int fd;
if (argc != 2) {
{
off_t size;
int fd;
if (argc != 2) {
- fprintf (stderr,
"use 'alloc file size' to create an image\n"
);
+ fprintf (stderr,
_("use 'alloc file size' to create an image\n")
);
return -1;
}
if (parse_size (argv[1], &size) == -1)
return -1;
return -1;
}
if (parse_size (argv[1], &size) == -1)
return -1;
- if (
g_launched
) {
- fprintf (stderr,
"can't allocate or add disks after launching\n"
);
+ if (
!guestfs_is_config (g)
) {
+ fprintf (stderr,
_("can't allocate or add disks after launching\n")
);
return -1;
}
return -1;
}
- fd = open (argv[0], O_WRONLY|O_CREAT|O_NOCTTY|O_
NONBLOCK|O_
TRUNC, 0666);
+ fd = open (argv[0], O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC, 0666);
if (fd == -1) {
perror (argv[0]);
return -1;
if (fd == -1) {
perror (argv[0]);
return -1;
@@
-91,14
+91,14
@@
parse_size (const char *str, off_t *size_rtn)
case 'g': case 'G': size *= 1024 * 1024 * 1024; break;
case 's': size *= 512; break;
default:
case 'g': case 'G': size *= 1024 * 1024 * 1024; break;
case 's': size *= 512; break;
default:
- fprintf (stderr,
"could not parse size specification '%s'\n"
, str);
+ fprintf (stderr,
_("could not parse size specification '%s'\n")
, str);
return -1;
}
}
else if (sscanf (str, "%"SCNu64, &size) == 1)
size *= 1024;
else {
return -1;
}
}
else if (sscanf (str, "%"SCNu64, &size) == 1)
size *= 1024;
else {
- fprintf (stderr,
"could not parse size specification '%s'\n"
, str);
+ fprintf (stderr,
_("could not parse size specification '%s'\n")
, str);
return -1;
}
return -1;
}