Commit 1b51530a authored by runge's avatar runge

x11vnc: remove compiler warnings; HP-UX tweaks.

parent a7726a6f
...@@ -445,6 +445,13 @@ AC_FUNC_VPRINTF ...@@ -445,6 +445,13 @@ AC_FUNC_VPRINTF
AC_FUNC_FORK AC_FUNC_FORK
AC_CHECK_LIB(nsl,gethostbyname) AC_CHECK_LIB(nsl,gethostbyname)
AC_CHECK_LIB(socket,socket) AC_CHECK_LIB(socket,socket)
uname_s=`(uname -s) 2>/dev/null`
if test "x$uname_s" = "xHP-UX"; then
# need -lsec for getspnam()
LDFLAGS="$LDFLAGS -lsec"
fi
AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid waitpid setutxent grantpt]) AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid waitpid setutxent grantpt])
# check, if shmget is in cygipc.a # check, if shmget is in cygipc.a
......
x11vnc README file Date: Tue Jul 4 12:02:55 EDT 2006 x11vnc README file Date: Tue Jul 4 14:26:15 EDT 2006
The following information is taken from these URLs: The following information is taken from these URLs:
......
...@@ -97,7 +97,7 @@ char *ip2host(char *ip) { ...@@ -97,7 +97,7 @@ char *ip2host(char *ip) {
int dotted_ip(char *host) { int dotted_ip(char *host) {
char *p = host; char *p = host;
while (*p != '\0') { while (*p != '\0') {
if (*p == '.' || isdigit(*p)) { if (*p == '.' || isdigit((unsigned char) (*p))) {
p++; p++;
continue; continue;
} }
......
...@@ -579,7 +579,7 @@ static void add_dead_keysyms(char *str) { ...@@ -579,7 +579,7 @@ static void add_dead_keysyms(char *str) {
p = str; p = str;
while (*p != '\0') { while (*p != '\0') {
if (isspace(*p)) { if (isspace((unsigned char) (*p))) {
*p = '\0'; *p = '\0';
} }
p++; p++;
......
...@@ -1170,7 +1170,11 @@ static void csock_timeout (int sig) { ...@@ -1170,7 +1170,11 @@ static void csock_timeout (int sig) {
static int wait_conn(int sock) { static int wait_conn(int sock) {
int conn; int conn;
struct sockaddr_in addr; struct sockaddr_in addr;
#ifdef __hpux
int addrlen = sizeof(addr);
#else
socklen_t addrlen = sizeof(addr); socklen_t addrlen = sizeof(addr);
#endif
signal(SIGALRM, csock_timeout); signal(SIGALRM, csock_timeout);
csock_timeout_sock = sock; csock_timeout_sock = sock;
...@@ -1262,7 +1266,11 @@ void accept_openssl(int mode) { ...@@ -1262,7 +1266,11 @@ void accept_openssl(int mode) {
int sock = -1, listen = -1, cport, csock, vsock; int sock = -1, listen = -1, cport, csock, vsock;
int status, n, i, db = 0; int status, n, i, db = 0;
struct sockaddr_in addr; struct sockaddr_in addr;
#ifdef __hpux
int addrlen = sizeof(addr);
#else
socklen_t addrlen = sizeof(addr); socklen_t addrlen = sizeof(addr);
#endif
rfbClientPtr client; rfbClientPtr client;
pid_t pid; pid_t pid;
char uniq[] = "__evilrats__"; char uniq[] = "__evilrats__";
......
...@@ -358,7 +358,7 @@ int crypt_verify(char *user, char *pass) { ...@@ -358,7 +358,7 @@ int crypt_verify(char *user, char *pass) {
if (db > 1) fprintf(stderr, "realpw='%s'\n", realpw); if (db > 1) fprintf(stderr, "realpw='%s'\n", realpw);
if (strlen(realpw) < 10) { if (strlen(realpw) < 12) {
/* e.g. "x", try getspnam(), sometimes root for inetd, etc */ /* e.g. "x", try getspnam(), sometimes root for inetd, etc */
#if LIBVNCSERVER_HAVE_GETSPNAM #if LIBVNCSERVER_HAVE_GETSPNAM
struct spwd *sp = getspnam(user); struct spwd *sp = getspnam(user);
...@@ -680,11 +680,11 @@ if (db) fprintf(stderr, "%s", buf); ...@@ -680,11 +680,11 @@ if (db) fprintf(stderr, "%s", buf);
} }
if (n == 1) { if (n == 1) {
if (isspace(buf[0])) { if (isspace((unsigned char) buf[0])) {
i--; i--;
continue; continue;
} }
instr[j++] = tolower(buf[0]); instr[j++] = tolower((unsigned char)buf[0]);
} }
if (n <= 0 || strstr(pstr, instr) != pstr) { if (n <= 0 || strstr(pstr, instr) != pstr) {
if (db) { if (db) {
......
...@@ -244,7 +244,7 @@ static void user2uid(char *user, uid_t *uid, char **name, char **home) { ...@@ -244,7 +244,7 @@ static void user2uid(char *user, uid_t *uid, char **name, char **home) {
q = user; q = user;
while (*q) { while (*q) {
if (! isdigit(*q++)) { if (! isdigit((unsigned char) (*q++))) {
numerical = 0; numerical = 0;
break; break;
} }
...@@ -810,7 +810,7 @@ int read_passwds(char *passfile) { ...@@ -810,7 +810,7 @@ int read_passwds(char *passfile) {
} }
p = line; p = line;
while (*p != '\0') { while (*p != '\0') {
if (! isspace(*p)) { if (! isspace((unsigned char) (*p))) {
blank = 0; blank = 0;
break; break;
} }
......
...@@ -103,7 +103,7 @@ void lowercase(char *str) { ...@@ -103,7 +103,7 @@ void lowercase(char *str) {
} }
p = str; p = str;
while (*p != '\0') { while (*p != '\0') {
*p = tolower(*p); *p = tolower((unsigned char) (*p));
p++; p++;
} }
} }
...@@ -115,7 +115,7 @@ void uppercase(char *str) { ...@@ -115,7 +115,7 @@ void uppercase(char *str) {
} }
p = str; p = str;
while (*p != '\0') { while (*p != '\0') {
*p = toupper(*p); *p = toupper((unsigned char) (*p));
p++; p++;
} }
} }
...@@ -123,7 +123,7 @@ void uppercase(char *str) { ...@@ -123,7 +123,7 @@ void uppercase(char *str) {
char *lblanks(char *str) { char *lblanks(char *str) {
char *p = str; char *p = str;
while (*p != '\0') { while (*p != '\0') {
if (! isspace(*p)) { if (! isspace((unsigned char) (*p))) {
break; break;
} }
p++; p++;
......
...@@ -1471,7 +1471,7 @@ static void init_freqtab(char *file) { ...@@ -1471,7 +1471,7 @@ static void init_freqtab(char *file) {
if (*q == ']') { if (*q == ']') {
break; break;
} }
if (! isdigit(*q)) { if (! isdigit((unsigned char) (*q))) {
if (0) fprintf(stderr, "extra: %s\n", p); if (0) fprintf(stderr, "extra: %s\n", p);
extra++; extra++;
ok = 0; ok = 0;
...@@ -1508,7 +1508,7 @@ static void init_freqtab(char *file) { ...@@ -1508,7 +1508,7 @@ static void init_freqtab(char *file) {
if (*q == ']') { if (*q == ']') {
break; break;
} }
if (! isdigit(*q)) { if (! isdigit((unsigned char) (*q))) {
extra++; extra++;
currn = maxn + extra; currn = maxn + extra;
ok = 0; ok = 0;
......
...@@ -754,7 +754,7 @@ static void check_rcfile(int argc, char **argv) { ...@@ -754,7 +754,7 @@ static void check_rcfile(int argc, char **argv) {
*(q-1) = ' '; *(q-1) = ' ';
break; break;
} }
while (isspace(*q)) { while (isspace((unsigned char) (*q))) {
*q = '\0'; *q = '\0';
if (q == p) { if (q == p) {
break; break;
...@@ -770,7 +770,7 @@ static void check_rcfile(int argc, char **argv) { ...@@ -770,7 +770,7 @@ static void check_rcfile(int argc, char **argv) {
if (*q == '\0') { if (*q == '\0') {
q--; q--;
} }
while (isspace(*q)) { while (isspace((unsigned char) (*q))) {
*q = '\0'; *q = '\0';
if (q == p) { if (q == p) {
break; break;
...@@ -793,7 +793,7 @@ static void check_rcfile(int argc, char **argv) { ...@@ -793,7 +793,7 @@ static void check_rcfile(int argc, char **argv) {
q = buf; q = buf;
while (*q) { while (*q) {
i++; i++;
if (*q == '\n' || isspace(*q)) { if (*q == '\n' || isspace((unsigned char) (*q))) {
break; break;
} }
q++; q++;
...@@ -1916,7 +1916,7 @@ int main(int argc, char* argv[]) { ...@@ -1916,7 +1916,7 @@ int main(int argc, char* argv[]) {
if (*s == '-') { if (*s == '-') {
s++; s++;
} }
if (isdigit(*s)) { if (isdigit((unsigned char) (*s))) {
no_repeat_countdown = atoi(argv[++i]); no_repeat_countdown = atoi(argv[++i]);
} }
} }
......
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#ifdef __hpux
/* to avoid select() compiler warning */
#include <sys/time.h>
#endif
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment