generator.ml: use new "Pathname" designation

Nearly every file-related function in daemons/*.c is affected:
Remove this pair of statements from each affected do_* function:
-  NEED_ROOT (return -1);
-  ABS_PATH (dir, return -1);
and change the type of the corresponding parameter to "const char *".
* src/generator.ml: Emit NEED_ROOT just once, even when there are two or
more Pathname args.
This commit is contained in:
Jim Meyering
2009-08-11 15:59:56 +02:00
parent 79b5084f70
commit 84fc760439
43 changed files with 206 additions and 339 deletions

View File

@@ -36,7 +36,7 @@ write_cb (void *fd_ptr, const void *buf, int len)
/* Has one FileIn parameter. */
int
do_upload (char *filename)
do_upload (const char *filename)
{
int err, fd, r, is_dev;
@@ -88,7 +88,7 @@ do_upload (char *filename)
/* Has one FileOut parameter. */
int
do_download (char *filename)
do_download (const char *filename)
{
int fd, r, is_dev;
char buf[GUESTFS_MAX_CHUNK_SIZE];