ia64/xen-unstable

changeset 11850:1e6d52d06fa4

[SOLARIS] A couple of simple compile fixes for tools/ on Solaris.

Signed-off-by: John Levon <john.levon@sun.com>
author kfraser@localhost.localdomain
date Tue Oct 17 18:15:59 2006 +0100 (2006-10-17)
parents 5b036362c1b0
children 0e22ecd169a0
files config/Linux.mk config/SunOS.mk tools/console/daemon/io.c tools/console/daemon/utils.c tools/ioemu/vl.c tools/libxc/xg_private.c tools/xcutils/readnotes.c tools/xenstat/xentop/Makefile tools/xenstat/xentop/xentop.c tools/xenstore/xenstored_core.c tools/xenstore/xsls.c
line diff
     1.1 --- a/config/Linux.mk	Tue Oct 17 18:05:42 2006 +0100
     1.2 +++ b/config/Linux.mk	Tue Oct 17 18:15:59 2006 +0100
     1.3 @@ -21,6 +21,7 @@ INSTALL_PROG = $(INSTALL) -m0755
     1.4  LIB64DIR = lib64
     1.5  
     1.6  SOCKET_LIBS =
     1.7 +CURSES_LIBS = -lncurses
     1.8  SONAME_LDFLAG = -soname
     1.9  SHLIB_CFLAGS = -shared
    1.10  
     2.1 --- a/config/SunOS.mk	Tue Oct 17 18:05:42 2006 +0100
     2.2 +++ b/config/SunOS.mk	Tue Oct 17 18:15:59 2006 +0100
     2.3 @@ -22,6 +22,7 @@ INSTALL_PROG = $(INSTALL) -m0755
     2.4  LIB64DIR = lib/amd64
     2.5  
     2.6  SOCKET_LIBS = -lsocket
     2.7 +CURSES_LIBS = -lcurses
     2.8  SONAME_LDFLAG = -h
     2.9  SHLIB_CFLAGS = -static-libgcc -shared
    2.10  
     3.1 --- a/tools/console/daemon/io.c	Tue Oct 17 18:05:42 2006 +0100
     3.2 +++ b/tools/console/daemon/io.c	Tue Oct 17 18:15:59 2006 +0100
     3.3 @@ -147,7 +147,7 @@ static int domain_create_tty(struct doma
     3.4  	int master;
     3.5  	bool success;
     3.6  
     3.7 -	if ((master = getpt()) == -1 ||
     3.8 +	if ((master = open("/dev/ptmx",O_RDWR|O_NOCTTY)) == -1 ||
     3.9  	    grantpt(master) == -1 || unlockpt(master) == -1) {
    3.10  		dolog(LOG_ERR, "Failed to create tty for domain-%d",
    3.11  		      dom->domid);
     4.1 --- a/tools/console/daemon/utils.c	Tue Oct 17 18:05:42 2006 +0100
     4.2 +++ b/tools/console/daemon/utils.c	Tue Oct 17 18:15:59 2006 +0100
     4.3 @@ -95,7 +95,7 @@ void daemonize(const char *pidfile)
     4.4  		exit(1);
     4.5  	}
     4.6  
     4.7 -	len = sprintf(buf, "%d\n", getpid());
     4.8 +	len = sprintf(buf, "%ld\n", (long)getpid());
     4.9  	if (write(fd, buf, len) < 0)
    4.10  		exit(1);
    4.11  
     5.1 --- a/tools/ioemu/vl.c	Tue Oct 17 18:05:42 2006 +0100
     5.2 +++ b/tools/ioemu/vl.c	Tue Oct 17 18:15:59 2006 +0100
     5.3 @@ -3028,7 +3028,7 @@ void net_slirp_smb(const char *exported_
     5.4      }
     5.5  
     5.6      /* XXX: better tmp dir construction */
     5.7 -    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
     5.8 +    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
     5.9      if (mkdir(smb_dir, 0700) < 0) {
    5.10          fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
    5.11          exit(1);
    5.12 @@ -3995,7 +3995,7 @@ static void create_pidfile(const char *f
    5.13                  perror("Opening pidfile");
    5.14                  exit(1);
    5.15              }
    5.16 -            fprintf(f, "%d\n", getpid());
    5.17 +            fprintf(f, "%ld\n", (long)getpid());
    5.18              fclose(f);
    5.19              pid_filename = qemu_strdup(filename);
    5.20              if (!pid_filename) {
    5.21 @@ -5942,7 +5942,7 @@ int main(int argc, char **argv)
    5.22      memset(&vnclisten_addr.sin_addr, 0, sizeof(vnclisten_addr.sin_addr));
    5.23      
    5.24      /* init debug */
    5.25 -    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%d.log", getpid());
    5.26 +    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%ld.log", (long)getpid());
    5.27      cpu_set_log_filename(qemu_dm_logfilename);
    5.28      cpu_set_log(0);
    5.29      
     6.1 --- a/tools/libxc/xg_private.c	Tue Oct 17 18:05:42 2006 +0100
     6.2 +++ b/tools/libxc/xg_private.c	Tue Oct 17 18:15:59 2006 +0100
     6.3 @@ -7,6 +7,7 @@
     6.4  #include <stdlib.h>
     6.5  #include <unistd.h>
     6.6  #include <zlib.h>
     6.7 +#include <strings.h>
     6.8  
     6.9  #include "xg_private.h"
    6.10  
     7.1 --- a/tools/xcutils/readnotes.c	Tue Oct 17 18:05:42 2006 +0100
     7.2 +++ b/tools/xcutils/readnotes.c	Tue Oct 17 18:15:59 2006 +0100
     7.3 @@ -56,7 +56,8 @@ static void print_numeric_note(const cha
     7.4  		       prefix, *(uint64_t *)ELFNOTE_DESC(note));
     7.5  		break;
     7.6  	default:
     7.7 -		printf("%s: unknown data size %#x\n", prefix, note->n_descsz);
     7.8 +		printf("%s: unknown data size %#lx\n", prefix,
     7.9 +		       (unsigned long)note->n_descsz);
    7.10  		break;
    7.11  	}
    7.12  }
    7.13 @@ -301,7 +302,8 @@ int main(int argc, char **argv)
    7.14  				print_string_note("FEATURES", note);
    7.15  				break;
    7.16  			default:
    7.17 -				printf("unknown note type %#x\n", note->n_type);
    7.18 +				printf("unknown note type %#lx\n",
    7.19 +				       (unsigned long)note->n_type);
    7.20  				break;
    7.21  			}
    7.22  		}
     8.1 --- a/tools/xenstat/xentop/Makefile	Tue Oct 17 18:05:42 2006 +0100
     8.2 +++ b/tools/xenstat/xentop/Makefile	Tue Oct 17 18:15:59 2006 +0100
     8.3 @@ -25,7 +25,7 @@ sbindir=$(prefix)/sbin
     8.4  
     8.5  CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT)
     8.6  LDFLAGS += -L$(XEN_LIBXENSTAT)
     8.7 -LDLIBS += -lxenstat -lncurses $(SOCKET_LIBS)
     8.8 +LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS)
     8.9  
    8.10  .PHONY: all
    8.11  all: xentop
    8.12 @@ -33,6 +33,7 @@ all: xentop
    8.13  .PHONY: install
    8.14  install: xentop xentop.1
    8.15  	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
    8.16 +	$(INSTALL_DIR) $(DESTDIR)$(man1dir)
    8.17  	$(INSTALL_DATA) xentop.1 $(DESTDIR)$(man1dir)/xentop.1
    8.18  
    8.19  endif
     9.1 --- a/tools/xenstat/xentop/xentop.c	Tue Oct 17 18:05:42 2006 +0100
     9.2 +++ b/tools/xenstat/xentop/xentop.c	Tue Oct 17 18:15:59 2006 +0100
     9.3 @@ -23,6 +23,7 @@
     9.4  #include <errno.h>
     9.5  #include <stdio.h>
     9.6  #include <stdlib.h>
     9.7 +#include <stdarg.h>
     9.8  #include <string.h>
     9.9  #include <sys/time.h>
    9.10  #include <time.h>
    9.11 @@ -266,7 +267,7 @@ static void print(const char *fmt, ...)
    9.12  	if (!batch) {
    9.13  		if((current_row() < lines()-1)) {
    9.14  			va_start(args, fmt);
    9.15 -			vw_printw(stdscr, fmt, args);
    9.16 +			vwprintw(stdscr, (char *)fmt, args);
    9.17  			va_end(args);
    9.18  		}
    9.19  	} else {
    9.20 @@ -280,7 +281,7 @@ static void print(const char *fmt, ...)
    9.21  static void attr_addstr(int attr, const char *str)
    9.22  {
    9.23  	attron(attr);
    9.24 -	addstr(str);
    9.25 +	addstr((char *)str);
    9.26  	attroff(attr);
    9.27  }
    9.28  
    9.29 @@ -1035,7 +1036,9 @@ int main(int argc, char **argv)
    9.30  		nonl();
    9.31  		keypad(stdscr, TRUE);
    9.32  		halfdelay(5);
    9.33 +#ifndef __sun__
    9.34  		use_default_colors();
    9.35 +#endif
    9.36  		init_pair(1, -1, COLOR_YELLOW);
    9.37  
    9.38  		do {
    10.1 --- a/tools/xenstore/xenstored_core.c	Tue Oct 17 18:05:42 2006 +0100
    10.2 +++ b/tools/xenstore/xenstored_core.c	Tue Oct 17 18:15:59 2006 +0100
    10.3 @@ -1688,7 +1688,7 @@ static void write_pidfile(const char *pi
    10.4  	if (lockf(fd, F_TLOCK, 0) == -1)
    10.5  		exit(0);
    10.6  
    10.7 -	len = sprintf(buf, "%d\n", getpid());
    10.8 +	len = sprintf(buf, "%ld\n", (long)getpid());
    10.9  	if (write(fd, buf, len) != len)
   10.10  		barf_perror("Writing pid file %s", pidfile);
   10.11  }
   10.12 @@ -1901,7 +1901,7 @@ int main(int argc, char *argv[])
   10.13  	restore_existing_connections();
   10.14  
   10.15  	if (outputpid) {
   10.16 -		printf("%i\n", getpid());
   10.17 +		printf("%ld\n", (long)getpid());
   10.18  		fflush(stdout);
   10.19  	}
   10.20  
    11.1 --- a/tools/xenstore/xsls.c	Tue Oct 17 18:05:42 2006 +0100
    11.2 +++ b/tools/xenstore/xsls.c	Tue Oct 17 18:15:59 2006 +0100
    11.3 @@ -6,6 +6,7 @@
    11.4  #include <getopt.h>
    11.5  #include <unistd.h>
    11.6  #include <sys/ioctl.h>
    11.7 +#include <termios.h>
    11.8  
    11.9  static int max_width = 80;
   11.10  static int desired_width = 60;