some fixes for solaris compiles.

toupper was redefined to handle strings, now renamed to toupper_str
disk.c has some more problems (it uses statfs and dirfd)


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@569 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2004-01-21 18:02:38 +00:00
parent a61eac7b19
commit 00af04fa57
7 changed files with 12 additions and 9 deletions

4
disk.c
View File

@ -116,7 +116,7 @@ disk_enum_devices(int *id, char *optarg)
pos2 = next_arg(optarg, '=');
strcpy(g_rdpdr_device[*id].name, optarg);
toupper(g_rdpdr_device[*id].name);
toupper_str(g_rdpdr_device[*id].name);
/* add trailing colon to name. */
strcat(g_rdpdr_device[*id].name, ":");
@ -212,7 +212,7 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
return STATUS_NO_SUCH_FILE;
}
}
handle = dirfd(dirp);
handle = dirfd(dirp); /* FIXME: dirfd is not portable */
}
else
{

View File

@ -48,7 +48,7 @@ parallel_enum_devices(int *id, char *optarg)
pos2 = next_arg(optarg, '=');
strcpy(g_rdpdr_device[*id].name, optarg);
toupper(g_rdpdr_device[*id].name);
toupper_str(g_rdpdr_device[*id].name);
g_rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1);
strcpy(g_rdpdr_device[*id].local_path, pos2);

View File

@ -102,7 +102,7 @@ printer_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 dispos
pprinter_data->printer_fp = popen(cmd, "w");
}
g_rdpdr_device[device_id].handle = pprinter_data->printer_fp->_fileno;
g_rdpdr_device[device_id].handle = fileno(pprinter_data->printer_fp);
*handle = g_rdpdr_device[device_id].handle;
return STATUS_SUCCESS;
}

View File

@ -69,7 +69,7 @@ void error(char *format, ...);
void warning(char *format, ...);
void unimpl(char *format, ...);
void hexdump(unsigned char *p, unsigned int len);
char *toupper(char* p);
void toupper_str(char* p);
char *ltoa(long N, int base);
int load_licence(unsigned char **data);
void save_licence(unsigned char *data, int length);

View File

@ -26,6 +26,7 @@
#include <sys/stat.h> /* stat */
#include <sys/time.h> /* gettimeofday */
#include <sys/times.h> /* times */
#include <ctype.h> /* toupper */
#include <errno.h>
#include "rdesktop.h"
@ -767,12 +768,12 @@ next_arg(char *src, char needle)
}
char *
toupper(char* p)
void
toupper_str(char* p)
{
while( *p ){
if( (*p >= 'a') && (*p <= 'z') )
*p = *p - 32;
*p = toupper((int) *p);
p++;
}
}

View File

@ -1,3 +1,4 @@
#include <unistd.h>
#include "rdesktop.h"
#define IRP_MJ_CREATE 0x00

View File

@ -1,6 +1,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <strings.h>
#include "rdesktop.h"
#define FILE_DEVICE_SERIAL_PORT 0x1b
@ -286,7 +287,7 @@ serial_enum_devices(int *id, char* optarg)
/* optarg = com1, pos2 = /dev/ttyS0 */
strcpy(g_rdpdr_device[*id].name,optarg);
toupper(g_rdpdr_device[*id].name);
toupper_str(g_rdpdr_device[*id].name);
g_rdpdr_device[*id].local_path = xmalloc( strlen(pos2) + 1 );
strcpy(g_rdpdr_device[*id].local_path,pos2);