# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 1e6d52d06fa41d43fe45de78ae858abcff05a144
# Parent 5b036362c1b0919c3a0bf85f7fe5fe7dd5565414
[SOLARIS] A couple of simple compile fixes for tools/ on Solaris.
Signed-off-by: John Levon <john.levon@xxxxxxx>
---
config/Linux.mk | 1 +
config/SunOS.mk | 1 +
tools/console/daemon/io.c | 2 +-
tools/console/daemon/utils.c | 2 +-
tools/ioemu/vl.c | 6 +++---
tools/libxc/xg_private.c | 1 +
tools/xcutils/readnotes.c | 6 ++++--
tools/xenstat/xentop/Makefile | 3 ++-
tools/xenstat/xentop/xentop.c | 7 +++++--
tools/xenstore/xenstored_core.c | 4 ++--
tools/xenstore/xsls.c | 1 +
11 files changed, 22 insertions(+), 12 deletions(-)
diff -r 5b036362c1b0 -r 1e6d52d06fa4 config/Linux.mk
--- a/config/Linux.mk Tue Oct 17 18:05:42 2006 +0100
+++ b/config/Linux.mk Tue Oct 17 18:15:59 2006 +0100
@@ -21,6 +21,7 @@ LIB64DIR = lib64
LIB64DIR = lib64
SOCKET_LIBS =
+CURSES_LIBS = -lncurses
SONAME_LDFLAG = -soname
SHLIB_CFLAGS = -shared
diff -r 5b036362c1b0 -r 1e6d52d06fa4 config/SunOS.mk
--- a/config/SunOS.mk Tue Oct 17 18:05:42 2006 +0100
+++ b/config/SunOS.mk Tue Oct 17 18:15:59 2006 +0100
@@ -22,6 +22,7 @@ LIB64DIR = lib/amd64
LIB64DIR = lib/amd64
SOCKET_LIBS = -lsocket
+CURSES_LIBS = -lcurses
SONAME_LDFLAG = -h
SHLIB_CFLAGS = -static-libgcc -shared
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/console/daemon/io.c Tue Oct 17 18:15:59 2006 +0100
@@ -147,7 +147,7 @@ static int domain_create_tty(struct doma
int master;
bool success;
- if ((master = getpt()) == -1 ||
+ if ((master = open("/dev/ptmx",O_RDWR|O_NOCTTY)) == -1 ||
grantpt(master) == -1 || unlockpt(master) == -1) {
dolog(LOG_ERR, "Failed to create tty for domain-%d",
dom->domid);
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/console/daemon/utils.c
--- a/tools/console/daemon/utils.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/console/daemon/utils.c Tue Oct 17 18:15:59 2006 +0100
@@ -95,7 +95,7 @@ void daemonize(const char *pidfile)
exit(1);
}
- len = sprintf(buf, "%d\n", getpid());
+ len = sprintf(buf, "%ld\n", (long)getpid());
if (write(fd, buf, len) < 0)
exit(1);
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/ioemu/vl.c Tue Oct 17 18:15:59 2006 +0100
@@ -3028,7 +3028,7 @@ void net_slirp_smb(const char *exported_
}
/* XXX: better tmp dir construction */
- snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
+ snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
if (mkdir(smb_dir, 0700) < 0) {
fprintf(stderr, "qemu: could not create samba server dir '%s'\n",
smb_dir);
exit(1);
@@ -3995,7 +3995,7 @@ static void create_pidfile(const char *f
perror("Opening pidfile");
exit(1);
}
- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%ld\n", (long)getpid());
fclose(f);
pid_filename = qemu_strdup(filename);
if (!pid_filename) {
@@ -5942,7 +5942,7 @@ int main(int argc, char **argv)
memset(&vnclisten_addr.sin_addr, 0, sizeof(vnclisten_addr.sin_addr));
/* init debug */
- sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%d.log", getpid());
+ sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%ld.log",
(long)getpid());
cpu_set_log_filename(qemu_dm_logfilename);
cpu_set_log(0);
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/libxc/xg_private.c Tue Oct 17 18:15:59 2006 +0100
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <zlib.h>
+#include <strings.h>
#include "xg_private.h"
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/xcutils/readnotes.c
--- a/tools/xcutils/readnotes.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/xcutils/readnotes.c Tue Oct 17 18:15:59 2006 +0100
@@ -56,7 +56,8 @@ static void print_numeric_note(const cha
prefix, *(uint64_t *)ELFNOTE_DESC(note));
break;
default:
- printf("%s: unknown data size %#x\n", prefix, note->n_descsz);
+ printf("%s: unknown data size %#lx\n", prefix,
+ (unsigned long)note->n_descsz);
break;
}
}
@@ -301,7 +302,8 @@ int main(int argc, char **argv)
print_string_note("FEATURES", note);
break;
default:
- printf("unknown note type %#x\n", note->n_type);
+ printf("unknown note type %#lx\n",
+ (unsigned long)note->n_type);
break;
}
}
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/xenstat/xentop/Makefile
--- a/tools/xenstat/xentop/Makefile Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/xenstat/xentop/Makefile Tue Oct 17 18:15:59 2006 +0100
@@ -25,7 +25,7 @@ sbindir=$(prefix)/sbin
CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT)
LDFLAGS += -L$(XEN_LIBXENSTAT)
-LDLIBS += -lxenstat -lncurses $(SOCKET_LIBS)
+LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS)
.PHONY: all
all: xentop
@@ -33,6 +33,7 @@ all: xentop
.PHONY: install
install: xentop xentop.1
$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
+ $(INSTALL_DIR) $(DESTDIR)$(man1dir)
$(INSTALL_DATA) xentop.1 $(DESTDIR)$(man1dir)/xentop.1
endif
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/xenstat/xentop/xentop.c Tue Oct 17 18:15:59 2006 +0100
@@ -23,6 +23,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
@@ -266,7 +267,7 @@ static void print(const char *fmt, ...)
if (!batch) {
if((current_row() < lines()-1)) {
va_start(args, fmt);
- vw_printw(stdscr, fmt, args);
+ vwprintw(stdscr, (char *)fmt, args);
va_end(args);
}
} else {
@@ -280,7 +281,7 @@ static void attr_addstr(int attr, const
static void attr_addstr(int attr, const char *str)
{
attron(attr);
- addstr(str);
+ addstr((char *)str);
attroff(attr);
}
@@ -1035,7 +1036,9 @@ int main(int argc, char **argv)
nonl();
keypad(stdscr, TRUE);
halfdelay(5);
+#ifndef __sun__
use_default_colors();
+#endif
init_pair(1, -1, COLOR_YELLOW);
do {
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/xenstore/xenstored_core.c Tue Oct 17 18:15:59 2006 +0100
@@ -1688,7 +1688,7 @@ static void write_pidfile(const char *pi
if (lockf(fd, F_TLOCK, 0) == -1)
exit(0);
- len = sprintf(buf, "%d\n", getpid());
+ len = sprintf(buf, "%ld\n", (long)getpid());
if (write(fd, buf, len) != len)
barf_perror("Writing pid file %s", pidfile);
}
@@ -1901,7 +1901,7 @@ int main(int argc, char *argv[])
restore_existing_connections();
if (outputpid) {
- printf("%i\n", getpid());
+ printf("%ld\n", (long)getpid());
fflush(stdout);
}
diff -r 5b036362c1b0 -r 1e6d52d06fa4 tools/xenstore/xsls.c
--- a/tools/xenstore/xsls.c Tue Oct 17 18:05:42 2006 +0100
+++ b/tools/xenstore/xsls.c Tue Oct 17 18:15:59 2006 +0100
@@ -6,6 +6,7 @@
#include <getopt.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#include <termios.h>
static int max_width = 80;
static int desired_width = 60;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|