mirror of
https://github.com/DoctorWkt/unix-jun72.git
synced 2026-04-12 15:16:44 +00:00
Remove all of the Apout compile warnings on Ubuntu and FreeBSD.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* bsdtrap.c - Deal with 2.11BSD trap instructions.
|
||||
*
|
||||
* $Revision: 1.65 $
|
||||
* $Date: 2002/06/10 11:43:24 $
|
||||
* $Revision: 1.66 $
|
||||
* $Date: 2008/05/19 13:26:42 $
|
||||
*/
|
||||
#ifdef EMU211
|
||||
|
||||
@@ -191,7 +191,7 @@ bsdtrap()
|
||||
}
|
||||
case S_READ: /* DONE */
|
||||
TrapDebug((dbg_file, "%d bytes on %d ",uarg3,sarg1));
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
i = fread(buf, 1, uarg3, stream[sarg1]);
|
||||
@@ -199,31 +199,31 @@ bsdtrap()
|
||||
#endif
|
||||
i = read(sarg1, buf, uarg3); break;
|
||||
case S_LINK: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf2 = xlate_filename(&dspace[uarg2]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
buf2 = xlate_filename((char *)&dspace[uarg2]);
|
||||
i = link(buf, buf2); break;
|
||||
case S_SYMLINK: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf2 = xlate_filename(&dspace[uarg2]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
buf2 = xlate_filename((char *)&dspace[uarg2]);
|
||||
i = symlink(buf, buf2); break;
|
||||
case S_RENAME: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf2 = xlate_filename(&dspace[uarg2]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
buf2 = xlate_filename((char *)&dspace[uarg2]);
|
||||
i = rename(buf, buf2); break;
|
||||
case S_READLINK: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
i = readlink(buf, &dspace[uarg2], sarg3); break;
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = readlink(buf, (char *)&dspace[uarg2], sarg3); break;
|
||||
case S_ACCESS: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = access(buf, sarg2); break;
|
||||
case S_MKDIR: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = mkdir(buf, sarg2); break;
|
||||
case S_RMDIR: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = rmdir(buf); break;
|
||||
case S_ACCT: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = acct(buf); break;
|
||||
case S_WRITEV: /* DONE */
|
||||
case S_READV: /* DONE */
|
||||
@@ -240,7 +240,7 @@ bsdtrap()
|
||||
free(ivec);
|
||||
break;
|
||||
case S_WRITE: /* DONE */
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
TrapDebug((dbg_file, "%d bytes on %d ",uarg3,sarg1));
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
@@ -268,13 +268,13 @@ bsdtrap()
|
||||
case S_FLOCK:
|
||||
i = flock(sarg1,sarg2); break;
|
||||
case S_LSTAT: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
tr_stbuf = (struct tr_stat *) &dspace[uarg2];
|
||||
i = lstat(buf, &stbuf);
|
||||
TrapDebug((dbg_file, "on %s ",buf));
|
||||
goto dostat;
|
||||
case S_STAT: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
tr_stbuf = (struct tr_stat *) &dspace[uarg2];
|
||||
i = stat(buf, &stbuf);
|
||||
TrapDebug((dbg_file, "on %s ",buf));
|
||||
@@ -313,7 +313,7 @@ dostat:
|
||||
}
|
||||
break;
|
||||
case S_UTIMES: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
tr_del = (struct tr_timeval *) &dspace[uarg2];
|
||||
tr_oldel = (struct tr_timeval *) &dspace[uarg4];
|
||||
i= utimes(buf, utv);
|
||||
@@ -377,10 +377,10 @@ dostat:
|
||||
copylong(tr_oltval->it_value.tv_usec, oltval.it_value.tv_usec);
|
||||
break;
|
||||
case S_UNLINK: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = unlink(buf); break;
|
||||
case S_OPEN: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
|
||||
i = stat(buf, &stbuf); /* If file is a directory */
|
||||
if (i == 0 && (stbuf.st_mode & S_IFDIR)) {
|
||||
@@ -413,15 +413,15 @@ dostat:
|
||||
#endif
|
||||
break;
|
||||
case S_MKNOD: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = mknod(buf, sarg2, sarg3); break;
|
||||
case S_CHMOD: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chmod(buf, sarg2); break;
|
||||
case S_FCHMOD: /* DONE */
|
||||
i = fchmod(sarg1, sarg2); break;
|
||||
case S_TRUNCATE: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
larg1 = (sarg2 << 16) | uarg3;
|
||||
i = truncate(buf, larg1); break;
|
||||
case S_FTRUNCATE: /* DONE */
|
||||
@@ -432,7 +432,7 @@ dostat:
|
||||
case S_KILLPG: /* DONE */
|
||||
i = killpg(sarg1, sarg2); break;
|
||||
case S_CHOWN: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chown(buf, sarg2, sarg3); break;
|
||||
case S_PIPE: /* DONE */
|
||||
i = pipe(pfd);
|
||||
@@ -449,28 +449,28 @@ dostat:
|
||||
if (i == -1) break;
|
||||
i = pfd[0]; regs[1] = pfd[1]; break;
|
||||
case S_CHROOT: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
if (buf == NULL) {
|
||||
errno=ENOENT; i=-1; break;
|
||||
}
|
||||
set_apout_root(buf);
|
||||
i=0; break;
|
||||
case S_CHDIR: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chdir(buf); break;
|
||||
case S_FCHDIR: /* DONE */
|
||||
i = fchdir(sarg1); break;
|
||||
|
||||
#ifndef NO_CHFLAGS
|
||||
case S_CHFLAGS: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chflags(buf,uarg2); break;
|
||||
case S_FCHFLAGS: /* DONE */
|
||||
i = fchflags(sarg1,uarg2); break;
|
||||
#endif
|
||||
|
||||
case S_CREAT: /* DONE */
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = creat(buf, sarg2);
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(i)) {
|
||||
@@ -550,10 +550,10 @@ dostat:
|
||||
*shortptr= pfd[1];
|
||||
break;
|
||||
case S_RECV: /* DONE */
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
i = recv(sarg1, buf, sarg3, sarg4); break;
|
||||
case S_SEND: /* DONE */
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
i = send(sarg1, buf, sarg3, sarg4); break;
|
||||
case S_ACCEPT: /* DONE */
|
||||
tr_sock= (struct tr_sockaddr *)&dspace[uarg2];
|
||||
@@ -563,7 +563,7 @@ dostat:
|
||||
sock.sa_len=len;
|
||||
#endif
|
||||
memcpy(sock.sa_data, tr_sock->sa_data, len);
|
||||
i= accept(sarg1, &sock, &len);
|
||||
i= accept(sarg1, &sock, (socklen_t *)&len);
|
||||
if (i != -1) {
|
||||
sl_word(uarg3,len);
|
||||
memcpy(tr_sock->sa_data, sock.sa_data, len);
|
||||
@@ -577,7 +577,7 @@ dostat:
|
||||
sock.sa_len=len;
|
||||
#endif
|
||||
memcpy(sock.sa_data, tr_sock->sa_data, len);
|
||||
i= getpeername(sarg1, &sock, &len);
|
||||
i= getpeername(sarg1, &sock, (socklen_t *)&len);
|
||||
if (i != -1) {
|
||||
sl_word(uarg3,len);
|
||||
memcpy(tr_sock->sa_data, sock.sa_data, len);
|
||||
@@ -591,7 +591,7 @@ dostat:
|
||||
sock.sa_len=len;
|
||||
#endif
|
||||
memcpy(sock.sa_data, tr_sock->sa_data, len);
|
||||
i= getsockname(sarg1, &sock, &len);
|
||||
i= getsockname(sarg1, &sock, (socklen_t *)&len);
|
||||
if (i != -1) {
|
||||
sl_word(uarg3,len);
|
||||
memcpy(tr_sock->sa_data, sock.sa_data, len);
|
||||
@@ -625,8 +625,8 @@ dostat:
|
||||
sock.sa_len=len;
|
||||
#endif
|
||||
memcpy(sock.sa_data, tr_sock->sa_data, len);
|
||||
buf = &dspace[uarg2];
|
||||
i= recvfrom(sarg1, buf, sarg3, sarg4, &sock, &len);
|
||||
buf = (char *)&dspace[uarg2];
|
||||
i= recvfrom(sarg1, buf, sarg3, sarg4, &sock, (socklen_t *)&len);
|
||||
if (i != -1) {
|
||||
sl_word(uarg6,len);
|
||||
memcpy(tr_sock->sa_data, sock.sa_data, len);
|
||||
@@ -721,7 +721,7 @@ trap_execve(int want_env)
|
||||
u_int16_t cptr, cptr2;
|
||||
char *buf, *name, *origpath;
|
||||
|
||||
origpath = strdup(&dspace[uarg1]);
|
||||
origpath = strdup((char *)&dspace[uarg1]);
|
||||
name = xlate_filename(origpath);
|
||||
TrapDebug((dbg_file, "%s Execing %s (%s) ", progname, name, origpath));
|
||||
|
||||
@@ -733,7 +733,7 @@ trap_execve(int want_env)
|
||||
ll_word(cptr, cptr2);
|
||||
if (cptr2 == 0)
|
||||
break;
|
||||
buf = &dspace[cptr2];
|
||||
buf = (char *)&dspace[cptr2];
|
||||
Argv[Argc++] = strdup(buf);
|
||||
cptr += 2;
|
||||
TrapDebug((dbg_file, "%s ", buf));
|
||||
@@ -747,7 +747,7 @@ trap_execve(int want_env)
|
||||
ll_word(cptr, cptr2);
|
||||
if (cptr2 == 0)
|
||||
break;
|
||||
buf = &dspace[cptr2];
|
||||
buf = (char *)&dspace[cptr2];
|
||||
Envp[Envc++] = strdup(buf);
|
||||
cptr += 2;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* v1trap.c - Deal with 1st Edition trap instructions.
|
||||
*
|
||||
* $Revision: 1.15 $
|
||||
* $Date: 2002/06/10 11:43:24 $
|
||||
* $Revision: 1.16 $
|
||||
* $Date: 2008/05/19 13:26:42 $
|
||||
*/
|
||||
#ifdef EMUV1
|
||||
#include "defines.h"
|
||||
@@ -133,7 +133,7 @@ void v1trap()
|
||||
#define EPOCH71 31536000 /* # seconds from 1970 to 1971 */
|
||||
#define EPOCH72 63072000 /* # seconds from 1970 to 1972 */
|
||||
case V1_SMDATE:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
if (buf[0] == '\0') buf = "."; /* Not documented anywhere */
|
||||
if (uarg1 == 0) buf = "."; /* Who knows? for V1 */
|
||||
i = stat(buf, &stbuf);
|
||||
@@ -187,7 +187,7 @@ void v1trap()
|
||||
regs[0] = i;
|
||||
break;
|
||||
case V1_READ:
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
i = fread(buf, 1, sarg3, stream[sarg1]);
|
||||
@@ -197,12 +197,12 @@ void v1trap()
|
||||
TrapDebug((dbg_file, " on fd %d return %d ", sarg1, i));
|
||||
regs[0] = i; break;
|
||||
case V1_LINK:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf2 = xlate_filename(&dspace[uarg2]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
buf2 = xlate_filename((char *)&dspace[uarg2]);
|
||||
i = link(buf, buf2);
|
||||
regs[0] = i; break;
|
||||
case V1_WRITE:
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
i = fwrite(buf, 1, sarg3, stream[sarg1]);
|
||||
@@ -223,15 +223,15 @@ void v1trap()
|
||||
TrapDebug((dbg_file, " on fd %d return %d ", sarg1, i));
|
||||
break;
|
||||
case V1_STAT:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
if (buf[0] == '\0') buf = "."; /* Not documented anywhere */
|
||||
if (uarg1 == 0) buf = "."; /* Who knows? for V1 */
|
||||
buf2 = &dspace[uarg2];
|
||||
buf2 = (char *)&dspace[uarg2];
|
||||
i = stat(buf, &stbuf);
|
||||
TrapDebug((dbg_file, " on %s return %d ", buf, i));
|
||||
goto dostat;
|
||||
case V1_FSTAT:
|
||||
buf2 = &dspace[uarg2];
|
||||
buf2 = (char *)&dspace[uarg2];
|
||||
i = fstat(sarg1, &stbuf);
|
||||
TrapDebug((dbg_file, " on fd %d return %d ", sarg1, i));
|
||||
|
||||
@@ -258,11 +258,11 @@ void v1trap()
|
||||
larg = sectosixty(stbuf.st_mtime); copylong(t1->mtime, larg);
|
||||
break;
|
||||
case V1_UNLINK:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = unlink(buf);
|
||||
break;
|
||||
case V1_OPEN:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
|
||||
i = stat(buf, &stbuf); /* If file is a directory */
|
||||
if (i == 0 && (stbuf.st_mode & S_IFDIR)) {
|
||||
@@ -283,7 +283,7 @@ void v1trap()
|
||||
}
|
||||
regs[0] = i;
|
||||
|
||||
if (ValidFD(i) && !strncmp(&dspace[uarg1],"/dev/",5)) {
|
||||
if (ValidFD(i) && !strncmp((char *)&dspace[uarg1],"/dev/",5)) {
|
||||
TrapDebug((dbg_file, " (device file) "));
|
||||
isdev[i]=1;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ void v1trap()
|
||||
#endif
|
||||
break;
|
||||
case V1_CHMOD:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
mode = 0;
|
||||
if (uarg2 & V1_ST_SETUID) mode |= S_ISUID;
|
||||
if (uarg2 & V1_ST_EXEC) mode |= S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
@@ -312,7 +312,7 @@ void v1trap()
|
||||
i = chmod(buf, mode);
|
||||
break;
|
||||
case V1_MKDIR:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
mode = 0;
|
||||
if (uarg2 & V1_ST_SETUID) mode |= S_ISUID;
|
||||
if (uarg2 & V1_ST_EXEC) mode |= S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
@@ -323,17 +323,17 @@ void v1trap()
|
||||
i = mkdir(buf, mode);
|
||||
break;
|
||||
case V1_CHOWN:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
uarg2&= 0x3fff; /* Why are uids > 16384? */
|
||||
i = chown(buf, uarg2, 0);
|
||||
TrapDebug((dbg_file, " %d on %s return %d",uarg2,buf,i));
|
||||
break;
|
||||
case V1_CHDIR:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chdir(buf);
|
||||
break;
|
||||
case V1_CREAT:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
mode = 0;
|
||||
if (uarg2 & V1_ST_SETUID) mode |= S_ISUID;
|
||||
if (uarg2 & V1_ST_EXEC) mode |= S_IXUSR | S_IXGRP | S_IXOTH;
|
||||
@@ -432,7 +432,7 @@ static int v1trap_exec(void)
|
||||
u_int16_t cptr, cptr2;
|
||||
char *buf, *name, *origpath;
|
||||
|
||||
origpath = strdup(&dspace[uarg1]);
|
||||
origpath = strdup((char *)&dspace[uarg1]);
|
||||
name = xlate_filename(origpath);
|
||||
TrapDebug((dbg_file, "%s Execing %s ", progname, name));
|
||||
|
||||
@@ -443,7 +443,7 @@ static int v1trap_exec(void)
|
||||
ll_word(cptr, cptr2);
|
||||
if (cptr2 == 0)
|
||||
break;
|
||||
buf = &dspace[cptr2];
|
||||
buf = (char *)&dspace[cptr2];
|
||||
Argv[Argc++] = strdup(buf);
|
||||
cptr += 2;
|
||||
TrapDebug((dbg_file, "%s ", buf));
|
||||
@@ -491,7 +491,7 @@ static int v1open_dir(char *name)
|
||||
while ((dent = readdir(d)) != NULL) {
|
||||
v1dent.d_ino = dent->d_fileno & 0x7fff;
|
||||
if (v1dent.d_ino<41) v1dent.d_ino+=100;
|
||||
strncpy(v1dent.d_name, dent->d_name, 8);
|
||||
strncpy((char *)v1dent.d_name, dent->d_name, 8);
|
||||
write(i, &v1dent, 10);
|
||||
}
|
||||
closedir(d);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* v7trap.c - Deal with V7 trap instructions. V5 and V6 syscalls are also
|
||||
* done here, because the syscall interface is nearly the same as V7.
|
||||
*
|
||||
* $Revision: 1.48 $
|
||||
* $Date: 2008/05/15 07:52:45 $
|
||||
* $Revision: 1.49 $
|
||||
* $Date: 2008/05/19 13:24:35 $
|
||||
*/
|
||||
#include "defines.h"
|
||||
#include <sys/stat.h>
|
||||
@@ -71,6 +71,7 @@ v7trap()
|
||||
long larg;
|
||||
char *buf, *buf2;
|
||||
char *fmode; /* used with fdopen only */
|
||||
time_t tim;
|
||||
|
||||
struct stat stbuf; /* used in STAT */
|
||||
struct tr_v7stat *t; /* used in STAT */
|
||||
@@ -160,13 +161,14 @@ v7trap()
|
||||
#endif
|
||||
break;
|
||||
case S_TIME:
|
||||
i = time(&larg);
|
||||
tim= larg;
|
||||
i = time(&tim);
|
||||
|
||||
if ((Binary==IS_A68 || Binary==IS_V6) || (Binary==IS_V5)) {
|
||||
fixv6time(&larg); /* Fix annoying bug in V5/V6 ctime() */
|
||||
fixv6time(&tim); /* Fix annoying bug in V5/V6 ctime() */
|
||||
}
|
||||
regs[1] = larg & 0xffff;
|
||||
i = larg >> 16;
|
||||
regs[1] = tim & 0xffff;
|
||||
i = tim >> 16;
|
||||
break;
|
||||
case S_ALARM:
|
||||
i = alarm(uarg1); break;
|
||||
@@ -206,7 +208,7 @@ v7trap()
|
||||
i = i >> 16;
|
||||
break;
|
||||
case S_READ:
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
i = fread(buf, 1, uarg3, stream[sarg1]);
|
||||
@@ -216,17 +218,17 @@ v7trap()
|
||||
TrapDebug((dbg_file, " on fd %d return %d ",sarg1,i));
|
||||
break;
|
||||
case S_LINK:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf2 = xlate_filename(&dspace[uarg2]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
buf2 = xlate_filename((char *)&dspace[uarg2]);
|
||||
if (!strcmp(buf, buf2)) i=0; /* Happens on mkdir(1) */
|
||||
else i = link(buf, buf2);
|
||||
break;
|
||||
case S_ACCESS:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = access(buf, sarg2);
|
||||
break;
|
||||
case S_WRITE:
|
||||
buf = &dspace[uarg2];
|
||||
buf = (char *)&dspace[uarg2];
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (ValidFD(sarg1) && stream[sarg1])
|
||||
i = fwrite(buf, 1, uarg3, stream[sarg1]);
|
||||
@@ -260,7 +262,7 @@ v7trap()
|
||||
}
|
||||
break;
|
||||
case S_FTIME:
|
||||
buf = &dspace[uarg1];
|
||||
buf = (char *)&dspace[uarg1];
|
||||
tb = (struct tr_timeb *) buf;
|
||||
i = gettimeofday(&tv, &tz);
|
||||
if (i == -1) break;
|
||||
@@ -275,15 +277,15 @@ v7trap()
|
||||
tb->dstflag = tz.tz_dsttime;
|
||||
break;
|
||||
case S_STAT:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
if (buf[0]=='\0') buf="."; /* Not documented anywhere */
|
||||
if (uarg1==0) buf=".";
|
||||
buf2 = &dspace[uarg2];
|
||||
buf2 = (char *)&dspace[uarg2];
|
||||
i = stat(buf, &stbuf);
|
||||
TrapDebug((dbg_file, " on %s return %d ",buf,i));
|
||||
goto dostat;
|
||||
case S_FSTAT:
|
||||
buf2 = &dspace[uarg2];
|
||||
buf2 = (char *)&dspace[uarg2];
|
||||
i = fstat(sarg1, &stbuf);
|
||||
TrapDebug((dbg_file, " on fd %d return %d ",sarg1,i));
|
||||
|
||||
@@ -346,7 +348,7 @@ dostat:
|
||||
utv[0].tv_usec = utv[1].tv_usec = 0;
|
||||
copylong(dspace[uarg2], utv[0].tv_sec);
|
||||
copylong(dspace[uarg2+4], utv[1].tv_sec);
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
#if 0
|
||||
buf2 = &dspace[uarg2];
|
||||
buf3 = (char *) &(utv[0].tv_sec);
|
||||
@@ -359,10 +361,10 @@ dostat:
|
||||
|
||||
i = utimes(buf, utv); break;
|
||||
case S_UNLINK:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = unlink(buf); break;
|
||||
case S_OPEN:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
|
||||
i = stat(buf, &stbuf); /* If file is a directory */
|
||||
if (i == 0 && (stbuf.st_mode & S_IFDIR)) {
|
||||
@@ -392,7 +394,7 @@ dostat:
|
||||
#endif
|
||||
break;
|
||||
case S_MKNOD:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
|
||||
if ((uarg2 & 077000) == 040000) {
|
||||
/* It's a directory creation */
|
||||
@@ -401,12 +403,12 @@ dostat:
|
||||
i = mknod(buf, uarg2, sarg3);
|
||||
break;
|
||||
case S_CHMOD:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chmod(buf, uarg2); break;
|
||||
case S_KILL:
|
||||
i = kill(sarg1, sarg2); break;
|
||||
case S_CHOWN:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chown(buf, sarg2, sarg3); break;
|
||||
case S_PIPE:
|
||||
i = pipe(pfd);
|
||||
@@ -423,15 +425,15 @@ dostat:
|
||||
#endif
|
||||
i = pfd[0]; regs[1] = pfd[1]; break;
|
||||
case S_CHROOT:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
if (buf == NULL) { i=-1; errno=ENOENT; break; }
|
||||
set_apout_root(buf);
|
||||
i=0; break;
|
||||
case S_CHDIR:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = chdir(buf); break;
|
||||
case S_CREAT:
|
||||
buf = xlate_filename(&dspace[uarg1]);
|
||||
buf = xlate_filename((char *)&dspace[uarg1]);
|
||||
i = creat(buf, sarg2);
|
||||
#ifdef STREAM_BUFFERING
|
||||
if (i==-1) break;
|
||||
@@ -517,7 +519,7 @@ trap_exec(int want_env)
|
||||
u_int16_t cptr, cptr2;
|
||||
char *buf, *name, *origpath;
|
||||
|
||||
origpath = strdup(&dspace[uarg1]);
|
||||
origpath = strdup((char *)&dspace[uarg1]);
|
||||
name = xlate_filename(origpath);
|
||||
TrapDebug((dbg_file, "%s Execing %s ", progname, name));
|
||||
|
||||
@@ -530,7 +532,7 @@ trap_exec(int want_env)
|
||||
ll_word(cptr, cptr2);
|
||||
if (cptr2 == 0)
|
||||
break;
|
||||
buf = &dspace[cptr2];
|
||||
buf = (char *)&dspace[cptr2];
|
||||
Argv[Argc++] = strdup(buf);
|
||||
cptr += 2;
|
||||
TrapDebug((dbg_file, "%s ", buf));
|
||||
@@ -544,7 +546,7 @@ trap_exec(int want_env)
|
||||
ll_word(cptr, cptr2);
|
||||
if (cptr2 == 0)
|
||||
break;
|
||||
buf = &dspace[cptr2];
|
||||
buf = (char *)&dspace[cptr2];
|
||||
Envp[Envc++] = strdup(buf);
|
||||
cptr += 2;
|
||||
}
|
||||
@@ -589,7 +591,7 @@ open_dir(char *name)
|
||||
|
||||
while ((dent = readdir(d)) != NULL) {
|
||||
odent.d_ino = dent->d_fileno;
|
||||
strncpy(odent.d_name, dent->d_name, 14);
|
||||
strncpy((char *)odent.d_name, dent->d_name, 14);
|
||||
write(i, &odent, 16);
|
||||
}
|
||||
closedir(d);
|
||||
|
||||
Reference in New Issue
Block a user