X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fguestfsd.c;h=0112a7f0bac4f580437639eb925f10151548e474;hb=4580b79d9a47dc9b6ff76070b7b5cc8f3499da09;hp=15184384e85610937e0ec2602fbd7c6fa70b14c2;hpb=b6a0c8565cdf27e6d4fdf7adb1a66b30d45d5b92;p=libguestfs.git diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 1518438..0112a7f 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -55,9 +55,14 @@ static char *read_cmdline (void); -/* Also in guestfs.c */ -#define GUESTFWD_ADDR "10.0.2.4" -#define GUESTFWD_PORT "6666" +/* This is the default address we connect to for very old libraries + * which didn't specify the address and port number explicitly on the + * kernel command line. It's now recommended to always specify the + * address and port number on the command line, so this will not be + * used any more. + */ +#define OLD_GUESTFWD_ADDR "10.0.2.4" +#define OLD_GUESTFWD_PORT "6666" /* This is only a hint. If not defined, ignore it. */ #ifndef AI_ADDRCONFIG @@ -227,6 +232,7 @@ main (int argc, char *argv[]) setenv ("PATH", "/sbin:/usr/sbin:/bin:/usr/bin", 1); setenv ("SHELL", "/bin/sh", 1); setenv ("LC_ALL", "C", 1); + setenv ("TERM", "dumb", 1); #ifndef WIN32 /* We document that umask defaults to 022 (it should be this anyway). */ @@ -284,7 +290,7 @@ main (int argc, char *argv[]) /* Default vmchannel. */ if (vmchannel == NULL) { - vmchannel = strdup ("tcp:" GUESTFWD_ADDR ":" GUESTFWD_PORT); + vmchannel = strdup ("tcp:" OLD_GUESTFWD_ADDR ":" OLD_GUESTFWD_PORT); if (!vmchannel) { perror ("strdup"); exit (EXIT_FAILURE); @@ -537,10 +543,10 @@ add_string (char ***argv, int *size, int *alloc, const char *str) return 0; } -int +size_t count_strings (char *const *argv) { - int argc; + size_t argc; for (argc = 0; argv[argc] != NULL; ++argc) ;