From f6971a141558711fb09d9fa15c9de67772047b32 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 1 Aug 2006 22:31:42 +0000 Subject: [PATCH] djgpp-killer-20060801 kill djgpp code --- src/WINNT/afsd/NTMakefile | 32 --- src/WINNT/afsd/afsd.h | 13 - src/WINNT/afsd/afsd_init.c | 4 - src/WINNT/afsd/afsd_init.h | 5 - src/WINNT/afsd/cm.h | 4 - src/WINNT/afsd/cm_access.c | 4 - src/WINNT/afsd/cm_aclent.c | 2 - src/WINNT/afsd/cm_buf.c | 52 ---- src/WINNT/afsd/cm_buf.h | 4 - src/WINNT/afsd/cm_callback.c | 4 - src/WINNT/afsd/cm_cell.c | 2 - src/WINNT/afsd/cm_config.c | 162 +----------- src/WINNT/afsd/cm_config.h | 3 - src/WINNT/afsd/cm_conn.c | 37 --- src/WINNT/afsd/cm_daemon.c | 8 - src/WINNT/afsd/cm_dcache.c | 2 - src/WINNT/afsd/cm_dir.c | 2 - src/WINNT/afsd/cm_dnlc.c | 2 - src/WINNT/afsd/cm_dns.c | 21 -- src/WINNT/afsd/cm_dns_private.h | 82 ------- src/WINNT/afsd/cm_freelance.c | 48 ---- src/WINNT/afsd/cm_ioctl.c | 50 ---- src/WINNT/afsd/cm_rpc.c | 4 - src/WINNT/afsd/cm_rpc.h | 4 - src/WINNT/afsd/cm_scache.c | 2 - src/WINNT/afsd/cm_scache.h | 4 - src/WINNT/afsd/cm_server.c | 4 - src/WINNT/afsd/cm_server.h | 4 - src/WINNT/afsd/cm_user.c | 2 - src/WINNT/afsd/cm_utils.c | 2 - src/WINNT/afsd/cm_vnodeops.c | 2 - src/WINNT/afsd/cm_volume.c | 4 - src/WINNT/afsd/rawops.c | 7 +- src/WINNT/afsd/smb.c | 532 +--------------------------------------- src/WINNT/afsd/smb.h | 25 -- src/WINNT/afsd/smb3.c | 14 -- src/WINNT/afsd/smb3.h | 10 - src/WINNT/afsd/smb_ioctl.c | 24 -- src/WINNT/afsd/smb_ioctl.h | 5 - src/WINNT/client_osi/osi.h | 14 -- src/WINNT/client_osi/osifd.c | 6 - src/WINNT/client_osi/osifd.h | 6 - src/WINNT/client_osi/osilog.c | 20 -- src/WINNT/client_osi/osilog.h | 4 - src/WINNT/client_osi/osiqueue.c | 2 - src/WINNT/client_osi/osisleep.h | 13 - src/des/andrew-conf.h | 2 +- src/des/new_rnd_key.c | 4 +- src/lwp/iomgr.c | 216 +--------------- src/lwp/preempt.c | 2 +- src/lwp/process.s | 2 - src/lwp/timer.c | 4 - src/lwp/waitkey.c | 5 - src/rx/rx.c | 4 - src/rx/rx_getaddr.c | 3 - src/rx/rx_lwp.c | 8 - src/rx/rx_misc.c | 4 +- src/rx/rx_packet.c | 2 +- src/rx/rx_packet.h | 4 +- src/rx/rx_user.c | 19 +- src/rx/rx_xmit_nt.c | 15 +- src/rx/rx_xmit_nt.h | 2 - src/vlserver/vlserver.c | 2 +- 63 files changed, 22 insertions(+), 1533 deletions(-) diff --git a/src/WINNT/afsd/NTMakefile b/src/WINNT/afsd/NTMakefile index bcce371..b72e7e9 100644 --- a/src/WINNT/afsd/NTMakefile +++ b/src/WINNT/afsd/NTMakefile @@ -41,7 +41,6 @@ INCFILES =\ $(INCFILEDIR)\smb3.h \ $(INCFILEDIR)\smb_iocons.h \ $(INCFILEDIR)\smb_ioctl.h \ - $(INCFILEDIR)\afsmsg95.h \ $(INCFILEDIR)\afsrpc.h \ !IFDEF OSICRASH $(INCFILEDIR)\afsdcrash.h \ @@ -257,25 +256,6 @@ $(LOGON_DLLFILE): $(LOGON_DLLOBJS) $(LOGON_DLLLIBS) $(DEL) $*.lib $*.exp ############################################################################ -# afslog95.dll - -LOG95_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\afslog95.dll - -LOG95_DLLOBJS =\ - $(OUT)\afslog95.obj \ - $(OUT)\afslog95.res - -LOG95_DLLLIBS =\ - $(DESTDIR)\lib\afsauthent.lib \ - $(DESTDIR)\lib\libafsconf.lib - -$(LOG95_DLLFILE): $(LOG95_DLLOBJS) $(LOG95_DLLLIBS) - $(DLLGUILINK) $(LOGONLINKFLAGS) -def:afslog95.def dnsapi.lib mpr.lib - $(DLLPREP) - $(COPY) $*.lib $(DESTDIR)\lib - $(DEL) $*.lib $*.exp - -############################################################################ # Install target; primary makefile target install_objs: $(OUT)\cm_dns.obj $(OUT)\cm_config.obj $(LANAHELPERLIB) $(OUT)\afsicf.obj @@ -297,15 +277,6 @@ install: install_headers install_objs $(CONF_DLLFILE) \ $(EXEDIR)\afsshare.exe \ $(DESTDIR)\bin\kpasswd.exe $(EXEDIR)\cmdebug.exe $(EXEDIR)\afscpcc.exe -install9X: install_headers $(CONF_DLLFILE) \ - $(EXEDIR)\klog.exe \ - $(EXEDIR)\tokens.exe \ - $(EXEDIR)\unlog.exe $(EXEDIR)\afsd.exe $(EXEDIR)\afsd_service.exe \ - $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \ - $(LOGON_DLLFILE) $(LOG95_DLLFILE) \ - $(EXEDIR)\afsshare.exe \ - $(DESTDIR)\bin\kpasswd.exe - install_libutils: install_headers $(CONF_DLLFILE) \ $(EXEDIR)\klog.exe \ $(EXEDIR)\tokens.exe \ @@ -512,8 +483,6 @@ $(OUT)\afsd_service.res: afsd_service.rc afsd_eventmessages.rc AFS_component_ver $(OUT)\afslogon.res: afslogon.rc AFS_component_version_number.h -$(OUT)\afslog95.res: afslog95.rc AFS_component_version_number.h - $(OUT)\libafsconf.res: libafsconf.rc AFS_component_version_number.h ############################################################################ @@ -526,6 +495,5 @@ clean:: $(DEL) MSG?????.bin $(DEL) $(CONF_DLLFILE) $(DEL) $(LOGON_DLLFILE) - $(DEL) $(LOG95_DLLFILE) mkdir: diff --git a/src/WINNT/afsd/afsd.h b/src/WINNT/afsd/afsd.h index 3133a8c..db89733 100644 --- a/src/WINNT/afsd/afsd.h +++ b/src/WINNT/afsd/afsd.h @@ -12,22 +12,13 @@ #include -#ifndef DJGPP BOOL InitClass(HANDLE); BOOL InitInstance(HANDLE, int); LONG APIENTRY MainWndProc(HWND, unsigned int, unsigned int, long); BOOL APIENTRY About(HWND, unsigned int, unsigned int, long); -#endif /* !DJGPP */ -#ifndef DJGPP #include -#else /* DJGPP */ -#include -#include -#include "dosdefs95.h" -#include "largeint95.h" -#endif /* !DJGPP */ #include "afsdicon.h" @@ -64,11 +55,7 @@ BOOL APIENTRY About(HWND, unsigned int, unsigned int, long); #include "cm_freelance.h" #include "smb_ioctl.h" #include "afsd_init.h" -#ifdef DJGPP -#include "afs/afsmsg95.h" -#else #include "afsd_eventlog.h" -#endif #include #include diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index f820c6d..1b27595 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -380,7 +380,6 @@ configureBackConnectionHostNames(void) } -#if !defined(DJGPP) static void afsd_InitServerPreferences(void) { HKEY hkPrefs = 0; @@ -530,7 +529,6 @@ static void afsd_InitServerPreferences(void) RegCloseKey(hkPrefs); } } -#endif /* DJGPP */ /* * AFSD Initialization @@ -1238,9 +1236,7 @@ int afsd_InitCM(char **reasonP) /* Initialize the RPC server for session keys */ RpcInit(); -#if !defined(DJGPP) afsd_InitServerPreferences(); -#endif return 0; } diff --git a/src/WINNT/afsd/afsd_init.h b/src/WINNT/afsd/afsd_init.h index 6465341..b22dada 100644 --- a/src/WINNT/afsd/afsd_init.h +++ b/src/WINNT/afsd/afsd_init.h @@ -9,15 +9,10 @@ void afsi_start(); -#ifndef DJGPP int afsd_InitCM(char **reasonP); int afsd_InitSMB(char **reasonP, void *aMBfunc); void GenerateMiniDump(PEXCEPTION_POINTERS ep); -#else /* DJGPP */ -int afsd_InitCM(char **reasonP, struct cmd_syndesc *as, char *arock); -int afsd_InitSMB(char **reasonP); -#endif /* !DJGPP */ int afsd_InitDaemons(char **reasonP); void afsd_ForceTrace(BOOL flush); void afsd_SetUnhandledExceptionFilter(); diff --git a/src/WINNT/afsd/cm.h b/src/WINNT/afsd/cm.h index cbdd169..d4832fc 100644 --- a/src/WINNT/afsd/cm.h +++ b/src/WINNT/afsd/cm.h @@ -14,10 +14,6 @@ #define AFS_PTHREAD_ENV 1 #endif #include -#ifdef DJGPP /* we need these for vldbentry decl., etc. */ -#include -#include -#endif /* DJGPP */ /* from .xg file */ /* FIXME: these were "long" but Windows NT wants "int" */ diff --git a/src/WINNT/afsd/cm_access.c b/src/WINNT/afsd/cm_access.c index a40e17e..8e13434 100644 --- a/src/WINNT/afsd/cm_access.c +++ b/src/WINNT/afsd/cm_access.c @@ -10,16 +10,12 @@ #include #include -#ifndef DJGPP #include #include -#endif #include #include #include -#ifndef DJGPP #include -#endif #include #include "afsd.h" diff --git a/src/WINNT/afsd/cm_aclent.c b/src/WINNT/afsd/cm_aclent.c index f7cb725..5ae9cf3 100644 --- a/src/WINNT/afsd/cm_aclent.c +++ b/src/WINNT/afsd/cm_aclent.c @@ -10,9 +10,7 @@ #include #include -#ifndef DJGPP #include -#endif #include #include #include diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index aa6610b..a763468 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -12,9 +12,7 @@ #include #include -#ifndef DJGPP #include -#endif #include #include #include @@ -112,12 +110,8 @@ void buf_IncrSyncer(long parm) lock_ReleaseWrite(&buf_globalLock); nAtOnce = (long)sqrt((double)cm_data.buf_nbuffers); while (buf_ShutdownFlag == 0) { -#ifndef DJGPP i = SleepEx(5000, 1); if (i != 0) continue; -#else - thrd_Sleep(5000); -#endif /* DJGPP */ if (buf_ShutdownFlag == 1) return; @@ -342,9 +336,7 @@ long buf_Init(int newFile, cm_buf_ops_t *opsp, afs_uint64 nbuffers) "buf_IncrSyncer"); osi_assertx(phandle != NULL, "buf: can't create incremental sync proc"); -#ifndef DJGPP CloseHandle(phandle); -#endif /* !DJGPP */ } #ifdef TESTING @@ -358,7 +350,6 @@ long buf_Init(int newFile, cm_buf_ops_t *opsp, afs_uint64 nbuffers) */ long buf_AddBuffers(afs_uint64 nbuffers) { -#ifndef DJGPP /* The size of a virtual cache cannot be changed after it has * been created. Subsequent calls to MapViewofFile() with * an existing mapping object name would not allow the @@ -372,43 +363,6 @@ long buf_AddBuffers(afs_uint64 nbuffers) nbuffers, cm_data.buf_nbuffers); return CM_ERROR_INVAL; -#else - cm_buf_t *bp; - int i; - char *data; - - data = malloc(buf_nbuffers * cm_data.buf_blockSize); - - /* Create buffer headers and put in free list */ - bp = malloc(nbuffers * sizeof(*bp)); - - for (i=0; imx, "cm_buf_t"); - - /* grab appropriate number of bytes from aligned zone */ - bp->datap = data; - - bp->flags |= CM_BUF_INLRU; - - lock_ObtainWrite(&buf_globalLock); - /* note that buf_allp chain is covered by buf_globalLock now */ - bp->allp = cm_data.buf_allp; - cm_data.buf_allp = bp; - osi_QAdd((osi_queue_t **) &cm_data.buf_freeListp, &bp->q); - if (!cm_data.buf_freeListEndp) - cm_data.buf_freeListEndp = bp; - cm_data.buf_nbuffers++; - lock_ReleaseWrite(&buf_globalLock); - - bp++; - data += cm_data.buf_blockSize; - - } /* for loop over all buffers */ - - return 0; -#endif /* DJGPP */ } /* interface to set the number of buffers to an exact figure. @@ -958,10 +912,8 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp) osi_assert(!(bp->flags & (CM_BUF_READING | CM_BUF_WRITING))); /* setup offset, event */ -#ifndef DJGPP /* doesn't seem to be used */ bp->over.Offset = bp->offset.LowPart; bp->over.OffsetHigh = bp->offset.HighPart; -#endif /* !DJGPP */ /* start the I/O; may drop lock */ bp->flags |= CM_BUF_READING; @@ -974,9 +926,7 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp) if (code != 0) { /* failure or queued */ -#ifndef DJGPP /* cm_bufRead always returns 0 */ if (code != ERROR_IO_PENDING) { -#endif bp->error = code; bp->flags |= CM_BUF_ERROR; bp->flags &= ~CM_BUF_READING; @@ -990,9 +940,7 @@ long buf_Get(struct cm_scache *scp, osi_hyper_t *offsetp, cm_buf_t **bufpp) buf_ValidateBufQueues(); #endif /* TESTING */ return code; -#ifndef DJGPP } -#endif } else { /* otherwise, I/O completed instantly and we're done, except * for padding the xfr out with 0s and checking for EOF diff --git a/src/WINNT/afsd/cm_buf.h b/src/WINNT/afsd/cm_buf.h index 692c107..ed84ff8 100644 --- a/src/WINNT/afsd/cm_buf.h +++ b/src/WINNT/afsd/cm_buf.h @@ -85,9 +85,7 @@ typedef struct cm_buf { char *datap; /* data in this buffer */ unsigned long error; /* last error code, if CM_BUF_ERROR is set */ cm_user_t *userp; /* user who wrote to the buffer last */ -#ifndef DJGPP OVERLAPPED over; /* overlapped structure for I/O */ -#endif /* fields added for the CM; locked by scp->mx */ long dataVersion; /* data version of this page */ @@ -152,9 +150,7 @@ extern cm_buf_t *buf_LockedFind(struct cm_scache *, osi_hyper_t *); extern cm_buf_t *buf_Find(struct cm_scache *, osi_hyper_t *); -#ifndef DJGPP extern HANDLE buf_GetFileHandle(long); -#endif /* !DJGPP */ extern void buf_LockedCleanAsync(cm_buf_t *, cm_req_t *); diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 5e52b53..1793306 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -11,12 +11,8 @@ #include #include -#ifndef DJGPP #include #include -#else -#include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index b74c1a8..23114b3 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -10,11 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index ab8e5d7..bca3520 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -11,13 +11,8 @@ #include #include -#ifndef DJGPP #include #include -#else -#include -#include -#endif /* !DJGPP */ #include #include #include @@ -31,23 +26,13 @@ #endif /* TODO: these should be pulled in from dirpath.h */ -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) #define AFS_THISCELL "ThisCell" -#endif #define AFS_CELLSERVDB_UNIX "CellServDB" #define AFS_CELLSERVDB_NT "afsdcell.ini" #ifndef AFSDIR_CLIENT_ETC_DIRPATH #define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs" #endif -#if defined(DJGPP) || defined(AFS_WIN95_ENV) -#define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX -#ifdef DJGPP -extern char cm_confDir[]; -extern int errno; -#endif /* DJGPP */ -#else #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX -#endif /* DJGPP || WIN95 */ static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp) { @@ -149,10 +134,6 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, int foundCell = 0; long code; int tracking = 1, partial = 0; -#if defined(DJGPP) || defined(AFS_WIN95_ENV) - char *afsconf_path; - DWORD dwSize; -#endif if ( IsWindowsModule(cellNamep) ) return -3; @@ -160,33 +141,9 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, cm_GetCellServDB(wdir); tfilep = fopen(wdir, "r"); -#if defined(DJGPP) || defined(AFS_WIN95_ENV) - if (!tfilep) { - /* If we are using DJGPP client, cellservdb will be in afsconf dir. */ - /* If we are in Win95 here, we are linking with klog etc. and are - using DJGPP client even though DJGPP is not defined. So we still - need to check AFSCONF for location. */ - dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0); - afsconf_path = malloc(dwSize); - dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize); - if (!afsconf_path) - strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); - else { - strcpy(wdir, afsconf_path); - free(afsconf_path); - } - strcat(wdir, "/"); - strcat(wdir, AFS_CELLSERVDB); - /*fprintf(stderr, "opening cellservdb file %s\n", wdir);*/ - tfilep = fopen(wdir, "r"); - if (!tfilep) - return -2; - } -#else /* If we are NT or higher, we don't do DJGPP, So just fail */ if ( !tfilep ) return -2; -#endif bestp = fopen(wdir, "r"); @@ -270,7 +227,6 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, else inRightCell = 0; } else { -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) valuep = strchr(lineBuffer, '#'); if (valuep == NULL) { fclose(tfilep); @@ -286,9 +242,7 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') valuep[strlen(valuep) - 1] = '\0'; -#endif /* !DJGPP */ if (inRightCell) { -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) /* add the server to the VLDB list */ WSASetLastError(0); thp = gethostbyname(valuep); @@ -305,9 +259,6 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep, (*procp)(rockp, &vlSockAddr, valuep); foundCell = 1; } -#else - thp = 0; -#endif /* !DJGPP */ if (!thp) { long ip_addr; int c1, c2, c3, c4; @@ -376,14 +327,12 @@ long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl, #endif /* AFS_AFSDB_ENV */ } -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) /* look up the CellServDBDir's name in the Registry * or use the Client Dirpath value to produce a CellServDB * filename */ long cm_GetCellServDB(char *cellNamep) { -#if !defined(DJGPP) DWORD code, dummyLen; HKEY parmKey; int tlen; @@ -406,10 +355,6 @@ long cm_GetCellServDB(char *cellNamep) tlen = (int)strlen(cellNamep); if (cellNamep[tlen-1] != '\\') strcat(cellNamep, "\\"); -#else - strcpy(cellNamep, cm_confDir); - strcat(cellNamep,"/"); -#endif /* !DJGPP */ strcat(cellNamep, AFS_CELLSERVDB); return 0; @@ -435,48 +380,6 @@ long cm_GetRootCellName(char *cellNamep) return 0; } -#else -/* look up the root cell's name in the THISCELL file */ -long cm_GetRootCellName(char *cellNamep) -{ - FILE *thisCell; - char thisCellPath[256]; - char *newline; - DWORD dwSize; - -#ifdef DJGPP - strcpy(thisCellPath, cm_confDir); -#else - /* Win 95 */ - char *afsconf_path; - dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0); - afsconf_path = malloc(dwSize); - dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize); - if (!afsconf_path) - strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH); - else { - strcpy(thisCellPath, afsconf_path); - free(afsconf_path); - } -#endif - strcat(thisCellPath,"/"); - - strcat(thisCellPath, AFS_THISCELL); - thisCell = fopen(thisCellPath, "r"); - if (thisCell == NULL) - return -1; - - fgets(cellNamep, 256, thisCell); - fclose(thisCell); - - newline = strrchr(cellNamep,'\n'); - if (newline) *newline = '\0'; - newline = strrchr(cellNamep,'\r'); - if (newline) *newline = '\0'; - - return 0; -} -#endif /* !DJGPP */ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp) { @@ -484,32 +387,11 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp) long tlen; FILE *tfilep; -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); /* add trailing backslash, if required */ tlen = (long)(strlen(wdir)); if (wdir[tlen-1] != '\\') strcat(wdir, "\\"); -#else -#ifdef DJGPP - strcpy(wdir,cm_confDir); -#else - DWORD dwSize; - char *afsconf_path; - - dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0); - afsconf_path = malloc(dwSize); - dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize); - - if (!afsconf_path) - strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); - else { - strcpy(wdir, afsconf_path); - free(afsconf_path); - } -#endif /* !DJGPP */ - strcat(wdir,"/"); -#endif /* DJGPP || WIN95 */ strcat(wdir, namep); @@ -518,7 +400,6 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp) return ((cm_configFile_t *) tfilep); } -#ifndef DJGPP long cm_WriteConfigString(char *labelp, char *valuep) { DWORD code, dummyDisp; @@ -538,9 +419,7 @@ long cm_WriteConfigString(char *labelp, char *valuep) return (long)0; } -#endif /* !DJGPP */ -#ifndef DJGPP long cm_WriteConfigInt(char *labelp, long value) { DWORD code, dummyDisp; @@ -560,7 +439,6 @@ long cm_WriteConfigInt(char *labelp, long value) return 0; } -#endif /* !DJGPP */ cm_configFile_t *cm_OpenCellFile(void) { @@ -657,34 +535,13 @@ long cm_CloseCellFile(cm_configFile_t *filep) long code; long closeCode; int tlen; -#ifdef AFS_WIN95_ENV - char *afsconf_path; - DWORD dwSize; -#endif - closeCode = fclose((FILE *)filep); + closeCode = fclose((FILE *)filep); -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); /* add trailing backslash, if required */ tlen = (int)strlen(wdir); if (wdir[tlen-1] != '\\') strcat(wdir, "\\"); -#else -#ifdef DJGPP - strcpy(wdir,cm_confDir); -#else - dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0); - afsconf_path = malloc(dwSize); - dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize); - if (!afsconf_path) - strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); - else { - strcpy(wdir, afsconf_path); - free(afsconf_path); - } -#endif /* !DJGPP */ - strcat(wdir,"/"); -#endif /* DJGPP || WIN95 */ strcpy(sdir, wdir); @@ -717,27 +574,10 @@ void cm_GetConfigDir(char *dir) DWORD dwSize; #endif -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); /* add trailing backslash, if required */ tlen = (int)strlen(wdir); if (wdir[tlen-1] != '\\') strcat(wdir, "\\"); -#else -#ifdef DJGPP - strcpy(wdir,cm_confDir); -#else - dwSize = GetEnvironmentVariable("AFSCONF", NULL, 0); - afsconf_path = malloc(dwSize); - dwSize = GetEnvironmentVariable("AFSCONF", afsconf_path, dwSize); - if (!afsconf_path) - strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH); - else { - strcpy(wdir, afsconf_path); - free(afsconf_path); - } -#endif /* !DJGPP */ - strcat(wdir,"\\"); -#endif /* DJGPP || WIN95 */ strcpy(dir, wdir); } diff --git a/src/WINNT/afsd/cm_config.h b/src/WINNT/afsd/cm_config.h index 0cc0578..2363054 100644 --- a/src/WINNT/afsd/cm_config.h +++ b/src/WINNT/afsd/cm_config.h @@ -21,9 +21,6 @@ #ifndef __CM_CONFIG_INTERFACES_ONLY__ #include -#ifdef DJGPP -#include -#endif /* DJGPP */ typedef FILE cm_configFile_t; diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index aa841e1..35b348e 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -10,9 +10,7 @@ #include #include -#ifndef DJGPP #include -#endif /* !DJGPP */ #include #include #include @@ -86,11 +84,7 @@ void cm_InitConn(void) void cm_InitReq(cm_req_t *reqp) { memset((char *)reqp, 0, sizeof(cm_req_t)); -#ifndef DJGPP reqp->startTime = GetTickCount(); -#else - gettimeofday(&reqp->startTime, NULL); -#endif } static long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp, @@ -186,12 +180,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, * and retry */ /* timeleft - get if from reqp the same way as cmXonnByMServers does */ -#ifndef DJGPP timeUsed = (GetTickCount() - reqp->startTime) / 1000; -#else - gettimeofday(&now, NULL); - timeUsed = sub_time(now, reqp->startTime) / 1000; -#endif /* leave 5 seconds margin for sleep */ timeLeft = HardDeadtimeout - timeUsed; @@ -336,44 +325,30 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, { char addr[16]; char *format; -#ifndef DJGPP DWORD msgID; -#endif switch ( errorCode ) { case VNOVOL: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VNOVOL; -#endif format = "Server %s reported volume %d as not attached."; break; case VMOVED: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VMOVED; -#endif format = "Server %s reported volume %d as moved."; break; case VOFFLINE: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VOFFLINE; -#endif format = "Server %s reported volume %d as offline."; break; case VSALVAGE: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VSALVAGE; -#endif format = "Server %s reported volume %d as needs salvage."; break; case VNOSERVICE: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VNOSERVICE; -#endif format = "Server %s reported volume %d as not in service."; break; case VIO: -#ifndef DJGPP msgID = MSG_SERVER_REPORTS_VIO; -#endif format = "Server %s reported volume %d as temporarily unaccessible."; break; } @@ -386,9 +361,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24)); osi_Log2(afsd_logp, format, osi_LogSaveString(afsd_logp,addr), fidp->volume); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, msgID, addr, fidp->volume); -#endif /* Mark server offline for this volume */ if (!serversp) { @@ -454,9 +427,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16), ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24)); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_RX_HARD_DEAD_TIME_EXCEEDED, addr); -#endif /* !DJGPP */ retry = 0; osi_Log1(afsd_logp, "cm_Analyze: hardDeadTime exceeded addr[%s]", @@ -605,9 +576,6 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, long firstError = 0; int someBusy = 0, someOffline = 0, allOffline = 1, allBusy = 1, allDown = 1; long timeUsed, timeLeft, hardTimeLeft; -#ifdef DJGPP - struct timeval now; -#endif /* DJGPP */ if (serversp == NULL) { osi_Log1(afsd_logp, "cm_ConnByMServers returning 0x%x", CM_ERROR_NOSUCHVOLUME); @@ -616,12 +584,7 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp, *connpp = NULL; -#ifndef DJGPP timeUsed = (GetTickCount() - reqp->startTime) / 1000; -#else - gettimeofday(&now, NULL); - timeUsed = sub_time(now, reqp->startTime) / 1000; -#endif /* leave 5 seconds margin of safety */ timeLeft = ConnDeadtimeout - timeUsed - 5; diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 7cff084..64aeb77 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -10,13 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#else -#include -#endif /* !DJGPP */ #include #include #include @@ -48,7 +44,6 @@ cm_bkgRequest_t *cm_bkgListEndp; /* last elt in the list of requests */ static int daemon_ShutdownFlag = 0; -#ifndef DJGPP void cm_IpAddrDaemon(long parm) { extern void smb_CheckVCs(void); @@ -66,7 +61,6 @@ void cm_IpAddrDaemon(long parm) } } } -#endif void cm_BkgDaemon(long parm) { @@ -383,13 +377,11 @@ void cm_InitDaemon(int nDaemons) lock_InitializeRWLock(&cm_daemonLock, "cm_daemonLock"); osi_EndOnce(&once); -#ifndef DJGPP /* creating IP Address Change monitor daemon */ phandle = thrd_Create((SecurityAttrib) 0, 0, (ThreadFunc) cm_IpAddrDaemon, 0, 0, &pid, "cm_IpAddrDaemon"); osi_assert(phandle != NULL); thrd_CloseHandle(phandle); -#endif /* DJGPP */ /* creating pinging daemon */ phandle = thrd_Create((SecurityAttrib) 0, 0, diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index cc548fd..426742f 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -10,11 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#endif /* !DJGPP */ #ifdef COMMENT #include #endif diff --git a/src/WINNT/afsd/cm_dir.c b/src/WINNT/afsd/cm_dir.c index 3e0dbfe..b5327dc 100644 --- a/src/WINNT/afsd/cm_dir.c +++ b/src/WINNT/afsd/cm_dir.c @@ -10,9 +10,7 @@ #include #include -#ifndef DJGPP #include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_dnlc.c b/src/WINNT/afsd/cm_dnlc.c index 184ca71..80eb857 100644 --- a/src/WINNT/afsd/cm_dnlc.c +++ b/src/WINNT/afsd/cm_dnlc.c @@ -18,10 +18,8 @@ #include #include -#ifndef DJGPP #include #include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_dns.c b/src/WINNT/afsd/cm_dns.c index f4e1b9d..6c09e05 100644 --- a/src/WINNT/afsd/cm_dns.c +++ b/src/WINNT/afsd/cm_dns.c @@ -11,10 +11,8 @@ #include #include #include -#ifndef DJGPP #include #include -#endif #include "cm_dns_private.h" #include "cm_dns.h" #include @@ -28,9 +26,6 @@ /*extern void afsi_log(char *pattern, ...);*/ static char dns_addr[30]; -#ifdef DJGPP -extern char cm_confDir[]; -#endif static int cm_dnsEnabled = -1; void DNSlowerCase(char *str) @@ -59,16 +54,8 @@ int cm_InitDNS(int enabled) strcpy(dns_addr, addr); } else { /* Now check for the AFSDNS.INI file */ -#ifdef DJGPP - strcpy(configpath, cm_confDir); -#elif defined(AFS_WIN95_ENV) - char *path = getenv("AFSCONF"); - if (path) strcpy(configpath, path); - else strcpy(configpath, "c:\\afscli"); -#else /* nt */ code = GetWindowsDirectory(configpath, sizeof(configpath)); if (code == 0 || code > sizeof(configpath)) return -1; -#endif strcat(configpath, "\\afsdns.ini"); /* Currently we only get (and query) the first nameserver. Getting @@ -665,14 +652,6 @@ int getAFSServer(char *cellName, int *cellHostAddrs, char cellHostNames[][MAXHOS return (-1); } -#ifdef DJGPP - /* the win95 sock.vxd will not allow sendto for unbound sockets, - * so just bind to nothing and it works */ - - __djgpp_set_socket_blocking_mode(commSock, 0); - bind(commSock,0,sizeof( SOCKADDR_IN ) ); -#endif /* DJGPP */ - strncpy(query, cellName, 1024); query[1023] = 0; if (query[strlen(query)-1] != '.') { diff --git a/src/WINNT/afsd/cm_dns_private.h b/src/WINNT/afsd/cm_dns_private.h index 1344fe0..65c90f3 100644 --- a/src/WINNT/afsd/cm_dns_private.h +++ b/src/WINNT/afsd/cm_dns_private.h @@ -9,15 +9,6 @@ #ifndef __DNS_AFS_private_h_env_ #define __DNS_AFS_private_h_env_ -#ifdef DJGPP -#include -#include -#include -#include -/*#else - #include */ -#endif - #ifdef KERNEL #define SOCKET struct osi_socket * #else @@ -30,79 +21,6 @@ #include -#ifdef DJGPP - -char *inet_ntoa(struct in_addr in) -{ - static char out[256]; - char temp[20]; - unsigned long sVal,pVal; - - out[0] = '\0'; - - - pVal = ntohl(in.s_addr); - - sVal = pVal; - sVal >>= 24; - sprintf(out,"%ld",sVal); - - sVal = pVal; - sVal <<= 8; - sVal >>= 24; - sprintf(out,"%s.%ld",out,sVal); - - sVal = pVal; - sVal <<= 16; - sVal >>= 24; - sprintf(out,"%s.%ld",out,sVal); - - sVal = pVal; - sVal <<= 24; - sVal >>= 24; - sprintf(out,"%s.%ld",out,sVal); - - return(&out[0]); -} - -unsigned long inet_addr(const char *cp) -{ - - unsigned long val=0; - unsigned char sVal; - - char cp2[256]; - - char* ptr = cp2; - int i; - int len; - - strcpy(cp2,cp); - - for (i=0; i<=strlen(cp); i++) - { - if (cp2[i] == '.') - { - cp2[i] = '\0'; - sVal = atoi(ptr); - ptr = &cp2[i+1]; - val = val << 8; - val &= 0xffffff00; - val |= sVal; - //printf("%x\t%lx\n",sVal,val); - }; - }; - sVal = atoi(ptr); - val = val << 8; - val &= 0xffffff00; - val |= sVal; - //printf("%x\t%lx\n",sVal,val); - - return htonl(val); -} - -#endif /* DJGPP */ - #define BUFSIZE 2048 /* diff --git a/src/WINNT/afsd/cm_freelance.c b/src/WINNT/afsd/cm_freelance.c index a875e57..2ad9c81 100644 --- a/src/WINNT/afsd/cm_freelance.c +++ b/src/WINNT/afsd/cm_freelance.c @@ -1,13 +1,9 @@ #include #include -#ifndef DJGPP #include #include #include -#else -#include -#endif /* !DJGPP */ #include #include #include @@ -33,14 +29,11 @@ int cm_freelanceEnabled = 1; time_t FakeFreelanceModTime = 0x3b49f6e2; static int freelance_ShutdownFlag = 0; -#if !defined(DJGPP) static HANDLE hFreelanceChangeEvent = 0; static HANDLE hFreelanceSymlinkChangeEvent = 0; -#endif void cm_InitFakeRootDir(); -#if !defined(DJGPP) void cm_FreelanceChangeNotifier(void * parmp) { HKEY hkFreelance = 0; @@ -130,25 +123,20 @@ void cm_FreelanceSymlinkChangeNotifier(void * parmp) { } } } -#endif void cm_FreelanceShutdown(void) { freelance_ShutdownFlag = 1; -#if !defined(DJGPP) if (hFreelanceChangeEvent != 0) thrd_SetEvent(hFreelanceChangeEvent); if (hFreelanceSymlinkChangeEvent != 0) thrd_SetEvent(hFreelanceSymlinkChangeEvent); -#endif } void cm_InitFreelance() { -#if !defined(DJGPP) thread_t phandle; int lpid; -#endif lock_InitializeMutex(&cm_Freelance_Lock, "Freelance Lock"); @@ -165,7 +153,6 @@ void cm_InitFreelance() { cm_InitFakeRootDir(); // --- end of yj code -#if !defined(DJGPP) /* Start the registry monitor */ phandle = thrd_Create(NULL, 65536, (ThreadFunc) cm_FreelanceChangeNotifier, NULL, 0, &lpid, "cm_FreelanceChangeNotifier"); @@ -176,7 +163,6 @@ void cm_InitFreelance() { NULL, 0, &lpid, "cm_FreelanceSymlinkChangeNotifier"); osi_assert(phandle != NULL); thrd_CloseHandle(phandle); -#endif } /* yj: Initialization of the fake root directory */ @@ -480,16 +466,13 @@ long cm_InitLocalMountPoints() { char hdir[120]; long code; char rootCellName[256]; -#if !defined(DJGPP) HKEY hkFreelance = 0, hkFreelanceSymlinks = 0; DWORD dwType, dwSize; DWORD dwMountPoints = 0; DWORD dwIndex; DWORD dwSymlinks = 0; FILETIME ftLastWriteTime; -#endif -#if !defined(DJGPP) if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance", 0, @@ -680,7 +663,6 @@ long cm_InitLocalMountPoints() { RegCloseKey(hkFreelance); return 0; } -#endif /* What follows is the old code to read freelance mount points * out of a text file modified to copy the data into the registry @@ -697,7 +679,6 @@ long cm_InitLocalMountPoints() { fp = fopen(hdir, "r"); } -#if !defined(DJGPP) RegCreateKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance", 0, @@ -708,12 +689,9 @@ long cm_InitLocalMountPoints() { &hkFreelance, NULL); dwIndex = 0; -#endif if (!fp) { -#if !defined(DJGPP) RegCloseKey(hkFreelance); -#endif rootCellName[0] = '.'; code = cm_GetRootCellName(&rootCellName[1]); if (code == 0) { @@ -769,7 +747,6 @@ long cm_InitLocalMountPoints() { if (t2) *(t2+1) = '\0'; -#if !defined(DJGPP) if ( hkFreelance ) { char szIndex[16]; /* we are migrating to the registry */ @@ -778,7 +755,6 @@ long cm_InitLocalMountPoints() { dwSize = (DWORD)strlen(line) + 1; RegSetValueEx( hkFreelance, szIndex, 0, dwType, line, dwSize); } -#endif // line is not empty, so let's parse it t = strchr(line, '#'); @@ -805,12 +781,10 @@ long cm_InitLocalMountPoints() { aLocalMountPoint++; } fclose(fp); -#if !defined(DJGPP) if ( hkFreelance ) { RegCloseKey(hkFreelance); DeleteFile(hdir); } -#endif return 0; } @@ -818,7 +792,6 @@ int cm_getNoLocalMountPoints() { return cm_noLocalMountPoints; } -#if !defined(DJGPP) long cm_FreelanceMountPointExists(char * filename) { char* cp; @@ -968,7 +941,6 @@ long cm_FreelanceSymlinkExists(char * filename) return found; } -#endif long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp) { @@ -978,12 +950,10 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, char fullname[200]; int n; int alias = 0; -#if !defined(DJGPP) HKEY hkFreelance = 0; DWORD dwType, dwSize; DWORD dwMountPoints; DWORD dwIndex; -#endif /* before adding, verify the cell name; if it is not a valid cell, don't add the mount point. @@ -1006,18 +976,15 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, return -1; } -#if !defined(DJGPP) if ( cm_FreelanceMountPointExists(filename) || cm_FreelanceSymlinkExists(filename) ) return -1; -#endif osi_Log1(afsd_logp,"Freelance Adding Mount for Cell: %s", osi_LogSaveString(afsd_logp,cellname)); lock_ObtainMutex(&cm_Freelance_Lock); -#if !defined(DJGPP) if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance", 0, @@ -1072,7 +1039,6 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, } RegCloseKey(hkFreelance); } else -#endif { cm_GetConfigDir(hfile); strcat(hfile, AFS_FREELANCE_INI); @@ -1111,16 +1077,13 @@ long cm_FreelanceRemoveMount(char *toremove) char hfile[120], hfile2[120]; FILE *fp1, *fp2; int found=0; -#if !defined(DJGPP) HKEY hkFreelance = 0; DWORD dwType, dwSize; DWORD dwMountPoints; DWORD dwIndex; -#endif lock_ObtainMutex(&cm_Freelance_Lock); -#if !defined(DJGPP) if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance", 0, @@ -1161,7 +1124,6 @@ long cm_FreelanceRemoveMount(char *toremove) } RegCloseKey(hkFreelance); } else -#endif { cm_GetConfigDir(hfile); strcat(hfile, AFS_FREELANCE_INI); @@ -1215,12 +1177,10 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp) char line[512]; char fullname[200]; int alias = 0; -#if !defined(DJGPP) HKEY hkFreelanceSymlinks = 0; DWORD dwType, dwSize; DWORD dwSymlinks; DWORD dwIndex; -#endif /* before adding, verify the filename. If it is already in use, either as * as mount point or a cellname, do not permit the creation of the symlink. @@ -1243,15 +1203,12 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp) return -1; } -#if !defined(DJGPP) if ( cm_FreelanceMountPointExists(filename) || cm_FreelanceSymlinkExists(filename) ) return -1; -#endif lock_ObtainMutex(&cm_Freelance_Lock); -#if !defined(DJGPP) if (RegCreateKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance\\Symlinks", 0, @@ -1306,7 +1263,6 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp) } RegCloseKey(hkFreelanceSymlinks); } -#endif lock_ReleaseMutex(&cm_Freelance_Lock); /* cm_reInitLocalMountPoints(); */ @@ -1324,16 +1280,13 @@ long cm_FreelanceRemoveSymlink(char *toremove) char line[512]; char shortname[200]; int found=0; -#if !defined(DJGPP) HKEY hkFreelanceSymlinks = 0; DWORD dwType, dwSize; DWORD dwSymlinks; DWORD dwIndex; -#endif lock_ObtainMutex(&cm_Freelance_Lock); -#if !defined(DJGPP) if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Freelance\\Symlinks", 0, @@ -1372,7 +1325,6 @@ long cm_FreelanceRemoveSymlink(char *toremove) } RegCloseKey(hkFreelanceSymlinks); } -#endif lock_ReleaseMutex(&cm_Freelance_Lock); cm_noteLocalMountPointChange(); diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 56de204..e552564 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -13,11 +13,7 @@ #include #include -#ifndef DJGPP #include -#else -#include -#endif /* !DJGPP */ #include #include #include @@ -34,13 +30,8 @@ #include "smb.h" #include "cm_server.h" -#ifndef DJGPP #include #include "afsrpc.h" -#else -#include -#include "afsrpc95.h" -#endif #include "cm_rpc.h" #include @@ -194,19 +185,10 @@ void cm_ResetACLCache(cm_user_t *userp) */ void TranslateExtendedChars(char *str) { -#ifdef DJGPP - char *p; -#endif - if (!str || !*str) return; -#ifndef DJGPP CharToOem(str, str); -#else - p = str; - while (*p) *p++ &= 0x7f; /* turn off high bit; probably not right */ -#endif } /* parse the passed-in file name and do a namei on it. If we fail, @@ -2052,12 +2034,10 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) } #endif -#ifndef DJGPP /* for win95, session key is back in pioctl */ /* uuid */ memcpy(&uuid, tp, sizeof(uuid)); if (!cm_FindTokenEvent(uuid, sessionKey)) return CM_ERROR_INVAL; -#endif /* !DJGPP */ } else { cellp = cm_data.rootCellp; osi_Log0(smb_logp,"cm_IoctlSetToken - no name specified"); @@ -2080,7 +2060,6 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) free(ucellp->ticketp); /* Discard old token if any */ ucellp->ticketp = malloc(ticketLen); memcpy(ucellp->ticketp, ticket, ticketLen); -#ifndef DJGPP /* * Get the session key from the RPC, rather than from the pioctl. */ @@ -2088,10 +2067,6 @@ long cm_IoctlSetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey)); */ memcpy(ucellp->sessionKey.data, sessionKey, sizeof(sessionKey)); -#else - /* for win95, we are getting the session key from the pioctl */ - memcpy(&ucellp->sessionKey, ct.HandShakeKey, sizeof(ct.HandShakeKey)); -#endif /* !DJGPP */ ucellp->kvno = ct.AuthHandle; ucellp->expirationTime = ct.EndTimestamp; ucellp->gen++; @@ -2169,7 +2144,6 @@ long cm_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp) /* clear token */ ct.AuthHandle = ucellp->kvno; -#ifndef DJGPP /* * Don't give out a real session key here */ @@ -2177,9 +2151,6 @@ long cm_IoctlGetTokenIter(struct smb_ioctl *ioctlp, struct cm_user *userp) memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey)); */ memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey)); -#else - memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey)); -#endif /* !DJGPP */ ct.ViceId = 37; /* XXX */ ct.BeginTimestamp = 0; /* XXX */ ct.EndTimestamp = ucellp->expirationTime; @@ -2214,10 +2185,7 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) cm_ucell_t *ucellp; struct ClearToken ct; char *tp; -#ifndef DJGPP afs_uuid_t uuid; -#endif /* !DJGPP */ - cm_SkipIoctlPath(ioctlp); tp = ioctlp->inDatap; @@ -2230,10 +2198,8 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) return CM_ERROR_NOSUCHCELL; tp += strlen(tp) + 1; -#ifndef DJGPP /* uuid */ memcpy(&uuid, tp, sizeof(uuid)); -#endif /* !DJGPP */ lock_ObtainMutex(&userp->mx); @@ -2258,7 +2224,6 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) /* clear token */ ct.AuthHandle = ucellp->kvno; -#ifndef DJGPP /* * Don't give out a real session key here */ @@ -2266,9 +2231,6 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey)); */ memset(ct.HandShakeKey, 0, sizeof(ct.HandShakeKey)); -#else - memcpy(ct.HandShakeKey, &ucellp->sessionKey, sizeof(ct.HandShakeKey)); -#endif /* !DJGPP */ ct.ViceId = 37; /* XXX */ ct.BeginTimestamp = 0; /* XXX */ ct.EndTimestamp = ucellp->expirationTime; @@ -2292,9 +2254,7 @@ long cm_IoctlGetToken(struct smb_ioctl *ioctlp, struct cm_user *userp) lock_ReleaseMutex(&userp->mx); -#ifndef DJGPP cm_RegisterNewTokenEvent(uuid, ucellp->sessionKey.data); -#endif /* !DJGPP */ return 0; } @@ -2617,16 +2577,6 @@ long cm_IoctlRxStatPeer(struct smb_ioctl *ioctlp, struct cm_user *userp) return 0; } -#ifdef DJGPP -extern int afsd_shutdown(int); -extern int afs_shutdown; - -long cm_IoctlShutdown(smb_ioctl_t *ioctlp, cm_user_t *userp) { - afs_shutdown = 1; /* flag to shut down */ - return 0; -} -#endif /* DJGPP */ - long cm_IoctlGetSMBName(smb_ioctl_t *ioctlp, cm_user_t *userp) { smb_user_t *uidp = ioctlp->uidp; diff --git a/src/WINNT/afsd/cm_rpc.c b/src/WINNT/afsd/cm_rpc.c index ad4d2a1..1fca278 100644 --- a/src/WINNT/afsd/cm_rpc.c +++ b/src/WINNT/afsd/cm_rpc.c @@ -15,11 +15,7 @@ #include #include -#ifndef DJGPP #include "afsrpc.h" -#else -#include "afsrpc95.h" -#endif #include "afsd.h" #include "afsd_init.h" diff --git a/src/WINNT/afsd/cm_rpc.h b/src/WINNT/afsd/cm_rpc.h index 8571ad7..89a3393 100644 --- a/src/WINNT/afsd/cm_rpc.h +++ b/src/WINNT/afsd/cm_rpc.h @@ -10,11 +10,7 @@ #ifndef __CM_RPC_H__ #define __CM_RPC_H__ -#ifndef DJGPP #include "afsrpc.h" -#else -#include "afsrpc95.h" -#endif void cm_RegisterNewTokenEvent(afs_uuid_t uuid, char sessionKey[8]); BOOL cm_FindTokenEvent(afs_uuid_t uuid, char sessionKey[8]); diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index ecf4aad..9d1de18 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -10,11 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_scache.h b/src/WINNT/afsd/cm_scache.h index 0384c19..7cb07bc 100644 --- a/src/WINNT/afsd/cm_scache.h +++ b/src/WINNT/afsd/cm_scache.h @@ -10,10 +10,6 @@ #ifndef __CM_SCACHE_H_ENV__ #define __CM_SCACHE_H_ENV__ 1 -#ifdef DJGPP -#include "largeint95.h" -#endif /* DJGPP */ - #define MOUNTPOINTLEN 1024 typedef struct cm_fid { diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index f04aec9..8ab1e63 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -10,13 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#else -#include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_server.h b/src/WINNT/afsd/cm_server.h index 611082c..c636108 100644 --- a/src/WINNT/afsd/cm_server.h +++ b/src/WINNT/afsd/cm_server.h @@ -10,11 +10,7 @@ #ifndef __CM_SERVER_H_ENV__ #define __CM_SERVER_H_ENV__ 1 -#ifndef DJGPP #include -#else /* DJGPP */ -#include -#endif /* !DJGPP */ #include /* pointed to by volumes and cells without holds; cm_serverLock is obtained diff --git a/src/WINNT/afsd/cm_user.c b/src/WINNT/afsd/cm_user.c index 0f53e05..2c6b174 100644 --- a/src/WINNT/afsd/cm_user.c +++ b/src/WINNT/afsd/cm_user.c @@ -10,9 +10,7 @@ #include #include -#ifndef DJGPP #include -#endif /* !DJGPP */ #include #include diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index d764a65..f85ca04 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -11,7 +11,6 @@ #include #include -#ifndef DJGPP #include #include #ifndef EWOULDBLOCK @@ -59,7 +58,6 @@ #define ESTALE WSAESTALE #define EREMOTE WSAEREMOTE #endif /* EWOULDBLOCK */ -#endif /* !DJGPP */ #include #include diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index ab6837d..da76567 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -10,10 +10,8 @@ #include #include -#ifndef DJGPP #include #include -#endif /* !DJGPP */ #include #include #include diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 83bd7a5..6f88515 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -10,13 +10,9 @@ #include #include -#ifndef DJGPP #include #include #include -#else -#include -#endif /* !DJGPP */ #include #include #include "afsd.h" diff --git a/src/WINNT/afsd/rawops.c b/src/WINNT/afsd/rawops.c index 4132f4d..bf19b02 100644 --- a/src/WINNT/afsd/rawops.c +++ b/src/WINNT/afsd/rawops.c @@ -316,12 +316,7 @@ long WriteData(cm_scache_t *scp, osi_hyper_t offset, long count, char *op, nbytes = count; /* don't go past end of request */ /* now copy the data */ -#ifdef DJGPP - if (dosflag) - dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex); - else -#endif /* DJGPP */ - memcpy(bufferp->datap + bufIndex, op, nbytes); + memcpy(bufferp->datap + bufIndex, op, nbytes); buf_SetDirty(bufferp); /* and record the last writer */ diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 51c3435..f2cf752 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -10,13 +10,8 @@ #include #include -#ifndef DJGPP #include #include -#else -#include -#include -#endif /* !DJGPP */ #include #include #include @@ -102,13 +97,7 @@ LANA_ENUM lana_list; /* for raw I/O */ osi_mutex_t smb_RawBufLock; -#ifdef DJGPP -#define SMB_RAW_BUFS 4 -dos_ptr smb_RawBufs; -int smb_RawBufSel[SMB_RAW_BUFS]; -#else char *smb_RawBufs; -#endif /* DJGPP */ #define SMB_MASKFLAG_TILDE 1 #define SMB_MASKFLAG_CASEFOLD 2 @@ -120,11 +109,7 @@ typedef struct raw_write_cont { long code; osi_hyper_t offset; long count; -#ifndef DJGPP char *buf; -#else - dos_ptr buf; -#endif /* DJGPP */ int writeMode; long alreadyWritten; } raw_write_cont_t; @@ -140,11 +125,9 @@ int smb_hideDotFiles; /* global state about V3 protocols */ int smb_useV3; /* try to negotiate V3 */ -#ifndef DJGPP static showErrors = 1; /* MessageBox or something like it */ int (_stdcall *smb_MBfunc)(HWND, LPCTSTR, LPCTSTR, UINT) = NULL; -#endif /* DJGPP */ /* GMT time info: * Time in Unix format of midnight, 1/1/1970 local time. @@ -174,21 +157,6 @@ DWORD smb_TlsRequestSlot = -1; void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, NCB *ncbp, raw_write_cont_t *rwcp); void smb_NetbiosInit(); -#ifdef DJGPP -#ifndef AFS_WIN95_ENV -DWORD smb_ServerExceptionFilter(void); -#endif - -extern char cm_HostName[]; -extern char cm_confDir[]; -#endif - -#ifdef DJGPP -#define LPTSTR char * -#define GetComputerName(str, sizep) \ - strcpy((str), cm_HostName); \ - *(sizep) = strlen(cm_HostName) -#endif /* DJGPP */ #ifdef LOG_PACKET void smb_LogPacket(smb_packet_t *packet); @@ -541,7 +509,6 @@ static int ExtractBits(WORD bits, short start, short len) return (int)num; } -#ifndef DJGPP void ShowUnixTime(char *FuncName, time_t unixTime) { FILETIME ft; @@ -567,9 +534,7 @@ void ShowUnixTime(char *FuncName, time_t unixTime) osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, msg)); } } -#endif /* DJGPP */ -#ifndef DJGPP /* Determine if we are observing daylight savings time */ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) { @@ -612,18 +577,6 @@ void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) */ *pDST = localDST.wHour != local.wHour; } -#else -/* Determine if we are observing daylight savings time */ -void GetTimeZoneInfo(BOOL *pDST, LONG *pDstBias, LONG *pBias) -{ - struct timeb t; - - ftime(&t); - *pDST = t.dstflag; - *pDstBias = -60; /* where can this be different? */ - *pBias = t.timezone; -} -#endif /* DJGPP */ void CompensateForSmbClientLastWriteTimeBugs(afs_uint32 *pLastWriteTime) @@ -687,7 +640,6 @@ smb_CalculateNowTZ() } #endif /* USE_NUMERIC_TIME_CONV */ -#ifndef DJGPP #ifdef USE_NUMERIC_TIME_CONV void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime) { @@ -739,29 +691,7 @@ void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime) SystemTimeToFileTime(&stm, largeTimep); } #endif /* USE_NUMERIC_TIME_CONV */ -#else /* DJGPP */ -void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime) -{ - /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ - /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 ??? */ - LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; - LARGE_INTEGER ut; - int leap_years = 89; /* leap years betw 1/1/1601 and 1/1/1970 */ - - /* set ft to number of 100ns intervals betw 1/1/1601 and 1/1/1970 GMT */ - *ft = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) - * 24 * 60); - *ft = LargeIntegerMultiplyByLong(*ft, 60); - *ft = LargeIntegerMultiplyByLong(*ft, 10000000); - - /* add unix time */ - ut = ConvertLongToLargeInteger(unixTime); - ut = LargeIntegerMultiplyByLong(ut, 10000000); - *ft = LargeIntegerAdd(*ft, ut); -} -#endif /* !DJGPP */ -#ifndef DJGPP #ifdef USE_NUMERIC_TIME_CONV void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep) { @@ -801,27 +731,6 @@ void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep) _timezone = save_timezone; } #endif /* USE_NUMERIC_TIME_CONV */ -#else /* DJGPP */ -void smb_UnixTimeFromLargeSearchTime(time_t *unixTimep, FILETIME *largeTimep) -{ - /* unixTime: seconds since 1/1/1970 00:00:00 GMT */ - /* FILETIME: 100ns intervals since 1/1/1601 00:00:00 GMT? */ - LARGE_INTEGER *ft = (LARGE_INTEGER *) largeTimep; - LARGE_INTEGER a; - int leap_years = 89; - - /* set to number of 100ns intervals betw 1/1/1601 and 1/1/1970 */ - a = ConvertLongToLargeInteger(((EPOCH_YEAR-1601) * 365 + leap_years) * 24 * 60); - a = LargeIntegerMultiplyByLong(a, 60); - a = LargeIntegerMultiplyByLong(a, 10000000); - - /* subtract it from ft */ - a = LargeIntegerSubtract(*ft, a); - - /* divide down to seconds */ - *unixTimep = LargeIntegerDivideByLong(a, 10000000); -} -#endif /* !DJGPP */ void smb_SearchTimeFromUnixTime(afs_uint32 *searchTimep, time_t unixTime) { @@ -880,12 +789,7 @@ void smb_DosUTimeFromUnixTime(afs_uint32 *dosUTimep, time_t unixTime) void smb_UnixTimeFromDosUTime(time_t *unixTimep, afs_uint32 dosTime) { -#ifndef DJGPP *unixTimep = dosTime + smb_localZero; -#else /* DJGPP */ - /* dosTime seems to be already adjusted for GMT */ - *unixTimep = dosTime; -#endif /* !DJGPP */ } smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana) @@ -1618,71 +1522,6 @@ char VNLCUserName[] = "%LCUSERNAME%"; char VNComputerName[] = "%COMPUTERNAME%"; char VNLCComputerName[] = "%LCCOMPUTERNAME%"; -#ifdef DJGPP -/* List available shares */ -int smb_ListShares() -{ - char sbmtpath[256]; - char pathName[256]; - char shareBuf[4096]; - int num_shares=0; - char *this_share; - int len; - char *p; - int print_afs = 0; - int code; - - /*strcpy(shareNameList[num_shares], "all"); - strcpy(pathNameList[num_shares++], "/afs");*/ - fprintf(stderr, "The following shares are available:\n"); - fprintf(stderr, "Share Name (AFS Path)\n"); - fprintf(stderr, "---------------------\n"); - fprintf(stderr, "\\\\%s\\%-16s (%s)\n", smb_localNamep, "ALL", cm_mountRoot); - -#ifndef DJGPP - code = GetWindowsDirectory(sbmtpath, sizeof(sbmtpath)); - if (code == 0 || code > sizeof(sbmtpath)) return -1; -#else - strcpy(sbmtpath, cm_confDir); -#endif /* !DJGPP */ - strcat(sbmtpath, "/afsdsbmt.ini"); - len = GetPrivateProfileString("AFS Submounts", NULL, NULL, - shareBuf, sizeof(shareBuf), - sbmtpath); - if (len == 0) { - return num_shares; - } - - this_share = shareBuf; - do - { - print_afs = 0; - /*strcpy(shareNameList[num_shares], this_share);*/ - len = GetPrivateProfileString("AFS Submounts", this_share, - NULL, - pathName, 256, - sbmtpath); - if (!len) - return num_shares; - p = pathName; - if (strncmp(p, cm_mountRoot, strlen(cm_mountRoot)) != 0) - print_afs = 1; - while (*p) { - if (*p == '\\') *p = '/'; /* change to / */ - p++; - } - - fprintf(stderr, "\\\\%s\\%-16s (%s%s)\n", - smb_localNamep, this_share, (print_afs ? cm_mountRoot : "\0"), - pathName); - num_shares++; - while (*this_share != 0) this_share++; /* find next NUL */ - this_share++; /* skip past the NUL */ - } while (*this_share != 0); /* stop at final NUL */ - - return num_shares; -} -#endif /* DJGPP */ typedef struct smb_findShare_rock { char * shareName; @@ -1723,9 +1562,6 @@ int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, char *shareName, char *var; char temp[1024]; DWORD sizeTemp; -#ifdef DJGPP - char sbmtpath[MAX_PATH]; -#endif char *p, *q; HKEY parmKey; DWORD code; @@ -1769,7 +1605,6 @@ int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, char *shareName, return 0; } -#ifndef DJGPP code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY "\\Submounts", 0, KEY_QUERY_VALUE, &parmKey); if (code == ERROR_SUCCESS) { @@ -1782,12 +1617,6 @@ int smb_FindShare(smb_vc_t *vcp, smb_user_t *uidp, char *shareName, } else { len = 0; } -#else /* DJGPP */ - strcpy(sbmtpath, cm_confDir); - strcat(sbmtpath, "/afsdsbmt.ini"); - len = GetPrivateProfileString("AFS Submounts", shareName, "", - pathName, sizeof(pathName), sbmtpath); -#endif /* !DJGPP */ if (len != 0 && len != sizeof(pathName) - 1) { /* We can accept either unix or PC style AFS pathnames. Convert * Unix-style to PC style here for internal use. @@ -2146,9 +1975,6 @@ smb_dirSearch_t *smb_NewDirSearch(int isV3) static smb_packet_t *GetPacket(void) { smb_packet_t *tbp; -#ifdef DJGPP - unsigned int npar, seg, tb_sel; -#endif lock_ObtainWrite(&smb_globalLock); tbp = smb_packetFreeListp; @@ -2156,11 +1982,7 @@ static smb_packet_t *GetPacket(void) smb_packetFreeListp = tbp->nextp; lock_ReleaseWrite(&smb_globalLock); if (!tbp) { -#ifndef DJGPP tbp = calloc(65540,1); -#else /* DJGPP */ - tbp = malloc(sizeof(smb_packet_t)); -#endif /* !DJGPP */ tbp->magic = SMB_PACKETMAGIC; tbp->ncbp = NULL; tbp->vcp = NULL; @@ -2174,25 +1996,6 @@ static smb_packet_t *GetPacket(void) tbp->flags = 0; tbp->spacep = NULL; -#ifdef DJGPP - npar = SMB_PACKETSIZE >> 4; /* number of paragraphs */ - { - signed int retval = - __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ - if (retval == -1) { - osi_Log1(smb_logp, "Cannot allocate %d paragraphs of DOS memory", - npar); - osi_panic("",__FILE__,__LINE__); - } - else { - osi_Log2(smb_logp, "Allocated %d paragraphs of DOS mem at 0x%X", - npar, retval); - seg = retval; - } - } - tbp->dos_pkt = (seg * 16) + 0; /* DOS physical address */ - tbp->dos_pkt_sel = tb_sel; -#endif /* DJGPP */ } osi_assert(tbp->magic == SMB_PACKETMAGIC); @@ -2214,9 +2017,6 @@ static NCB *GetNCB(void) { smb_ncb_t *tbp; NCB *ncbp; -#ifdef DJGPP - unsigned int npar, seg, tb_sel; -#endif /* DJGPP */ lock_ObtainWrite(&smb_globalLock); tbp = smb_ncbFreeListp; @@ -2224,27 +2024,7 @@ static NCB *GetNCB(void) smb_ncbFreeListp = tbp->nextp; lock_ReleaseWrite(&smb_globalLock); if (!tbp) { -#ifndef DJGPP tbp = calloc(sizeof(*tbp),1); -#else /* DJGPP */ - tbp = malloc(sizeof(*tbp)); - npar = (sizeof(NCB)+15) >> 4; /* number of paragraphs */ - { - signed int retval = - __dpmi_allocate_dos_memory(npar, &tb_sel); /* DOS segment */ - if (retval == -1) { - osi_Log1(smb_logp, "Cannot allocate %d paragraphs of DOS mem in GetNCB", - npar); - osi_panic("",__FILE__,__LINE__); - } else { - osi_Log2(smb_logp, "Allocated %d paragraphs of DOS mem at 0x%X in GetNCB", - npar, retval); - seg = retval; - } - } - tbp->dos_ncb = (seg * 16) + 0; /* DOS physical address */ - tbp->dos_ncb_sel = tb_sel; -#endif /* !DJGPP */ tbp->magic = SMB_NCBMAGIC; } @@ -2252,9 +2032,6 @@ static NCB *GetNCB(void) memset(&tbp->ncb, 0, sizeof(NCB)); ncbp = &tbp->ncb; -#ifdef DJGPP - dos_memset(tbp->dos_ncb, 0, sizeof(NCB)); -#endif /* DJGPP */ return ncbp; } @@ -2345,10 +2122,8 @@ unsigned int smb_GetSMBParm(smb_packet_t *smbp, int parm) parm, parmCount, smbp->ncb_length); osi_Log3(smb_logp,"Bad SMB param %d out of %d, ncb len %d", parm, parmCount, smbp->ncb_length); -#ifndef DJGPP LogEvent(EVENTLOG_ERROR_TYPE, MSG_BAD_SMB_PARAM, __FILE__, __LINE__, parm, parmCount, smbp->ncb_length); -#endif /* !DJGPP */ osi_panic(s, __FILE__, __LINE__); } parmDatap = smbp->wctp + (2*parm) + 1; @@ -2371,10 +2146,8 @@ unsigned int smb_GetSMBParmLong(smb_packet_t *smbp, int parm) parm, parmCount, smbp->ncb_length); osi_Log3(smb_logp,"Bad SMB param %d out of %d, ncb len %d", parm, parmCount, smbp->ncb_length); -#ifndef DJGPP LogEvent(EVENTLOG_ERROR_TYPE, MSG_BAD_SMB_PARAM, __FILE__, __LINE__, parm, parmCount, smbp->ncb_length); -#endif /* !DJGPP */ osi_panic(s, __FILE__, __LINE__); } parmDatap = smbp->wctp + (2*parm) + 1; @@ -2395,10 +2168,8 @@ unsigned int smb_GetSMBOffsetParm(smb_packet_t *smbp, int parm, int offset) sprintf(s, "Bad SMB param %d offset %d out of %d, ncb len %d", parm, offset, parmCount, smbp->ncb_length); -#ifndef DJGPP LogEvent(EVENTLOG_ERROR_TYPE, MSG_BAD_SMB_PARAM_WITH_OFFSET, __FILE__, __LINE__, parm, offset, parmCount, smbp->ncb_length); -#endif /* !DJGPP */ osi_Log4(smb_logp, "Bad SMB param %d offset %d out of %d, ncb len %d", parm, offset, parmCount, smbp->ncb_length); osi_panic(s, __FILE__, __LINE__); @@ -2561,18 +2332,12 @@ void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp) long code = 0; unsigned char *tp; int localNCB = 0; -#ifdef DJGPP - dos_ptr dos_ncb; -#endif /* DJGPP */ ncbp = inp->ncbp; if (ncbp == NULL) { ncbp = GetNCB(); localNCB = 1; } -#ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; -#endif /* DJGPP */ memset((char *)ncbp, 0, sizeof(NCB)); @@ -2586,24 +2351,13 @@ void smb_SendPacket(smb_vc_t *vcp, smb_packet_t *inp) ncbp->ncb_lsn = (unsigned char) vcp->lsn; /* vc to use */ ncbp->ncb_lana_num = vcp->lana; ncbp->ncb_command = NCBSEND; /* op means send data */ -#ifndef DJGPP ncbp->ncb_buffer = (char *) inp;/* packet */ code = Netbios(ncbp); -#else /* DJGPP */ - ncbp->ncb_buffer = inp->dos_pkt;/* packet */ - ((smb_ncb_t*)ncbp)->orig_pkt = inp; - - /* copy header information from virtual to DOS address space */ - dosmemput((char*)inp, SMB_PACKETSIZE, inp->dos_pkt); - code = Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ if (code != 0) { const char * s = ncb_error_string(code); osi_Log2(smb_logp, "SendPacket failure code %d \"%s\"", code, s); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_SMB_SEND_PACKET_FAILURE, s); -#endif /* !DJGPP */ lock_ObtainMutex(&vcp->mx); if (!(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) { @@ -2999,12 +2753,7 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp cm_user_t *userp = NULL; NCB *ncbp; int rc; -#ifndef DJGPP char *rawBuf = NULL; -#else - dos_ptr rawBuf = NULL; - dos_ptr dos_ncb; -#endif /* DJGPP */ rawBuf = NULL; finalCount = 0; @@ -3067,11 +2816,7 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp if (smb_RawBufs) { /* Get a raw buf, from head of list */ rawBuf = smb_RawBufs; -#ifndef DJGPP smb_RawBufs = *(char **)smb_RawBufs; -#else /* DJGPP */ - smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); -#endif /* !DJGPP */ } lock_ReleaseMutex(&smb_RawBufLock); if (!rawBuf) @@ -3081,19 +2826,11 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp if (fidp->flags & SMB_FID_IOCTL) { lock_ReleaseMutex(&fidp->mx); -#ifndef DJGPP rc = smb_IoctlReadRaw(fidp, vcp, inp, outp); -#else - rc = smb_IoctlReadRaw(fidp, vcp, inp, outp, rawBuf); -#endif if (rawBuf) { /* Give back raw buffer */ lock_ObtainMutex(&smb_RawBufLock); -#ifndef DJGPP *((char **) rawBuf) = smb_RawBufs; -#else /* DJGPP */ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); -#endif /* !DJGPP */ smb_RawBufs = rawBuf; lock_ReleaseMutex(&smb_RawBufLock); @@ -3106,13 +2843,7 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp userp = smb_GetUserFromVCP(vcp, inp); -#ifndef DJGPP code = smb_ReadData(fidp, &offset, count, rawBuf, userp, &finalCount); -#else /* DJGPP */ - /* have to give ReadData flag so it will treat buffer as DOS mem. */ - code = smb_ReadData(fidp, &offset, count, (unsigned char *)rawBuf, - userp, &finalCount, TRUE /* rawFlag */); -#endif /* !DJGPP */ if (code != 0) goto send; @@ -3125,9 +2856,6 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp send1: ncbp = outp->ncbp; -#ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; -#endif /* DJGPP */ memset((char *)ncbp, 0, sizeof(NCB)); ncbp->ncb_length = (unsigned short) finalCount; @@ -3136,22 +2864,14 @@ long smb_ReceiveCoreReadRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp ncbp->ncb_command = NCBSEND; ncbp->ncb_buffer = rawBuf; -#ifndef DJGPP code = Netbios(ncbp); -#else /* DJGPP */ - code = Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ if (code != 0) osi_Log1(smb_logp, "ReadRaw send failure code %d", code); if (rawBuf) { /* Give back raw buffer */ lock_ObtainMutex(&smb_RawBufLock); -#ifndef DJGPP *((char **) rawBuf) = smb_RawBufs; -#else /* DJGPP */ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); -#endif /* !DJGPP */ smb_RawBufs = rawBuf; lock_ReleaseMutex(&smb_RawBufLock); @@ -6027,13 +5747,8 @@ long smb_ReceiveCoreClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) /* * smb_ReadData -- common code for Read, Read And X, and Raw Read */ -#ifndef DJGPP long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, cm_user_t *userp, long *readp) -#else /* DJGPP */ -long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, - cm_user_t *userp, long *readp, int dosflag) -#endif /* !DJGPP */ { osi_hyper_t offset; long code = 0; @@ -6152,12 +5867,7 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, if (nbytes > count) nbytes = count; /* don't go past EOF */ /* now copy the data */ -#ifdef DJGPP - if (dosflag) - dosmemput(bufferp->datap + bufIndex, nbytes, (dos_ptr)op); - else -#endif /* DJGPP */ - memcpy(op, bufferp->datap + bufIndex, nbytes); + memcpy(op, bufferp->datap + bufIndex, nbytes); /* adjust counters, pointers, etc. */ op += nbytes; @@ -6181,13 +5891,8 @@ long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, /* * smb_WriteData -- common code for Write and Raw Write */ -#ifndef DJGPP long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, cm_user_t *userp, long *writtenp) -#else /* DJGPP */ -long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, - cm_user_t *userp, long *writtenp, int dosflag) -#endif /* !DJGPP */ { osi_hyper_t offset; long code = 0; @@ -6373,12 +6078,7 @@ long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, nbytes = count; /* don't go past end of request */ /* now copy the data */ -#ifdef DJGPP - if (dosflag) - dosmemget((dos_ptr)op, nbytes, bufferp->datap + bufIndex); - else -#endif /* DJGPP */ - memcpy(bufferp->datap + bufIndex, op, nbytes); + memcpy(bufferp->datap + bufIndex, op, nbytes); buf_SetDirty(bufferp); /* and record the last writer */ @@ -6542,11 +6242,7 @@ long smb_ReceiveCoreWrite(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) code = 0; while ( code == 0 && count > 0 ) { -#ifndef DJGPP code = smb_WriteData(fidp, &offset, count, op, userp, &written); -#else /* DJGPP */ - code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE); -#endif /* !DJGPP */ if (code == 0 && written == 0) code = CM_ERROR_PARTIALWRITE; @@ -6581,11 +6277,7 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, unsigned short fd; smb_fid_t *fidp; cm_user_t *userp; -#ifndef DJGPP char *rawBuf; -#else /* DJGPP */ - dos_ptr rawBuf; -#endif /* !DJGPP */ long written = 0; long code = 0; @@ -6597,17 +6289,9 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, userp = smb_GetUserFromVCP(vcp, inp); -#ifndef DJGPP rawBuf = rwcp->buf; code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, rawBuf, userp, &written); -#else /* DJGPP */ - rawBuf = (dos_ptr) rwcp->buf; - code = smb_WriteData(fidp, &rwcp->offset, rwcp->count, - (unsigned char *) rawBuf, userp, - &written, TRUE); -#endif /* !DJGPP */ - if (rwcp->writeMode & 0x1) { /* synchronous */ smb_t *op; @@ -6629,11 +6313,7 @@ void smb_CompleteWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, /* Give back raw buffer */ lock_ObtainMutex(&smb_RawBufLock); -#ifndef DJGPP *((char **)rawBuf) = smb_RawBufs; -#else /* DJGPP */ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); -#endif /* !DJGPP */ smb_RawBufs = rawBuf; lock_ReleaseMutex(&smb_RawBufLock); @@ -6657,12 +6337,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out cm_user_t *userp; char *op; unsigned short writeMode; -#ifndef DJGPP char *rawBuf; -#else /* DJGPP */ - dos_ptr rawBuf; -#endif /* !DJGPP */ - fd = smb_GetSMBParm(inp, 0); totalCount = smb_GetSMBParm(inp, 1); count = smb_GetSMBParm(inp, 10); @@ -6756,11 +6431,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out code = 0; while ( code == 0 && count > 0 ) { -#ifndef DJGPP code = smb_WriteData(fidp, &offset, count, op, userp, &written); -#else /* DJGPP */ - code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE); -#endif /* !DJGPP */ if (code == 0 && written == 0) code = CM_ERROR_PARTIALWRITE; @@ -6779,11 +6450,7 @@ long smb_ReceiveCoreWriteRaw(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *out if (smb_RawBufs) { /* Get a raw buf, from head of list */ rawBuf = smb_RawBufs; -#ifndef DJGPP smb_RawBufs = *(char **)smb_RawBufs; -#else /* DJGPP */ - smb_RawBufs = _farpeekl(_dos_ds, smb_RawBufs); -#endif /* !DJGPP */ } else code = CM_ERROR_USESTD; @@ -6908,11 +6575,7 @@ long smb_ReceiveCoreRead(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) *op++ = (unsigned char) (count & 0xff); *op++ = (unsigned char) ((count >> 8) & 0xff); -#ifndef DJGPP code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount); -#else /* DJGPP */ - code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE); -#endif /* !DJGPP */ /* fix some things up */ smb_SetSMBParm(outp, 0, finalCount); @@ -7339,10 +7002,8 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, /* Sanity check */ if (ncbp->ncb_length < offsetof(struct smb, vdata)) { /* log it and discard it */ -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_BAD_SMB_TOO_SHORT, __FILE__, __LINE__, ncbp->ncb_length); -#endif /* !DJGPP */ osi_Log1(smb_logp, "SMB message too short, len %d", ncbp->ncb_length); return; } @@ -7415,10 +7076,8 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, if (oldGen != sessionGen) { newTime = GetTickCount(); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_BAD_SMB_WRONG_SESSION, newTime - oldTime, ncbp->ncb_length); -#endif /* !DJGPP */ osi_Log2(smb_logp, "Pkt straddled session startup, " "took %d ms, ncb length %d", newTime - oldTime, ncbp->ncb_length); } @@ -7430,7 +7089,6 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, smb_LogPacket(inp); #endif /* LOG_PACKET */ -#ifndef DJGPP if (showErrors) { sprintf(tbuffer, "Received bad SMB req 0x%x", inp->inCom); code = (*smb_MBfunc)(NULL, tbuffer, "Cancel: don't show again", @@ -7438,16 +7096,13 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, if (code == IDCANCEL) showErrors = 0; } -#endif /* DJGPP */ code = CM_ERROR_BADOP; } /* catastrophic failure: log as much as possible */ if (code == CM_ERROR_BADSMB) { -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_BAD_SMB_INVALID, ncbp->ncb_length); -#endif /* !DJGPP */ #ifdef LOG_PACKET smb_LogPacket(inp); #endif /* LOG_PACKET */ @@ -7558,7 +7213,6 @@ void smb_DispatchPacket(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp, return; } -#ifndef DJGPP /* Wait for Netbios() calls to return, and make the results available to server * threads. Note that server threads can't wait on the NCBevents array * themselves, because NCB events are manual-reset, and the servers would race @@ -7612,7 +7266,6 @@ void smb_ClientWaiter(void *parmp) thrd_SetEvent(NCBreturns[0][idx]); } } -#endif /* !DJGPP */ /* * Try to have one NCBRECV request waiting for every live session. Not more @@ -7623,9 +7276,6 @@ void smb_ServerWaiter(void *parmp) DWORD code; int idx_session, idx_NCB; NCB *ncbp; -#ifdef DJGPP - dos_ptr dos_ncb; -#endif /* DJGPP */ while (smbShutdownFlag == 0) { /* Get a session */ @@ -7718,19 +7368,10 @@ void smb_ServerWaiter(void *parmp) ncbp->ncb_lsn = (unsigned char) LSNs[idx_session]; ncbp->ncb_command = NCBRECV | ASYNCH; ncbp->ncb_lana_num = lanas[idx_session]; -#ifndef DJGPP ncbp->ncb_buffer = (unsigned char *) bufs[idx_NCB]; ncbp->ncb_event = NCBevents[idx_NCB]; ncbp->ncb_length = SMB_PACKETSIZE; Netbios(ncbp); -#else /* DJGPP */ - ncbp->ncb_buffer = bufs[idx_NCB]->dos_pkt; - ((smb_ncb_t*)ncbp)->orig_pkt = bufs[idx_NCB]; - ncbp->ncb_event = NCBreturns[0][idx_NCB]; - ncbp->ncb_length = SMB_PACKETSIZE; - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; - Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ } } @@ -7756,9 +7397,6 @@ void smb_Server(VOID *parmp) UCHAR rc; smb_vc_t *vcp = NULL; smb_t *smbp; -#ifdef DJGPP - dos_ptr dos_ncb; -#endif /* DJGPP */ rx_StartClientThread(); @@ -7820,9 +7458,6 @@ void smb_Server(VOID *parmp) } ncbp = NCBs[idx_NCB]; -#ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; -#endif /* DJGPP */ idx_session = NCBsessions[idx_NCB]; rc = ncbp->ncb_retcode; @@ -7841,10 +7476,8 @@ void smb_Server(VOID *parmp) case NRC_SNUMOUT: case NRC_SABORT: -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_UNEXPECTED_SMB_SESSION_CLOSE, ncb_error_string(rc)); /* fallthrough */ -#endif /* !DJGPP */ case NRC_SCLOSED: /* Client closed session */ vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]); @@ -7869,10 +7502,8 @@ void smb_Server(VOID *parmp) case NRC_INCOMP: /* Treat as transient error */ -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_BAD_SMB_INCOMPLETE, ncbp->ncb_length); -#endif /* !DJGPP */ osi_Log1(smb_logp, "dispatch smb recv failed, message incomplete, ncb_length %d", ncbp->ncb_length); @@ -7968,22 +7599,11 @@ void smb_Server(VOID *parmp) vcp->errorCount = 0; bufp = (struct smb_packet *) ncbp->ncb_buffer; -#ifdef DJGPP - bufp = ((smb_ncb_t *) ncbp)->orig_pkt; - /* copy whole packet to virtual memory */ - /*fprintf(stderr, "smb_Server: copying dos packet at 0x%x, " - "bufp=0x%x\n", - bufp->dos_pkt / 16, bufp);*/ - fflush(stderr); - dosmemget(bufp->dos_pkt, ncbp->ncb_length, bufp->data); -#endif /* DJGPP */ smbp = (smb_t *)bufp->data; outbufp->flags = 0; -#if !defined(DJGPP) && !defined(AFS_WIN32_ENV) __try { -#endif if (smbp->com == 0x1d) { /* Special handling for Write Raw */ raw_write_cont_t rwc; @@ -8001,11 +7621,7 @@ void smb_Server(VOID *parmp) ncbp->ncb_buffer = rwc.buf; ncbp->ncb_length = 65535; ncbp->ncb_event = rwevent; -#ifndef DJGPP Netbios(ncbp); -#else - Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ rcode = thrd_WaitForSingleObject_Event(rwevent, RAWTIMEOUT); thrd_CloseHandle(rwevent); } @@ -8025,11 +7641,9 @@ void smb_Server(VOID *parmp) /* TODO: what else needs to be serialized? */ smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL); } -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) } __except( smb_ServerExceptionFilter() ) { } -#endif smb_concurrentCalls--; @@ -8046,7 +7660,6 @@ void smb_Server(VOID *parmp) * force trace and give control to upstream exception handlers. Useful for * debugging. */ -#if !defined(DJGPP) && !defined(AFS_WIN95_ENV) DWORD smb_ServerExceptionFilter(void) { /* While this is not the best time to do a trace, if it succeeds, then * we have a trace (assuming tracing was enabled). Otherwise, this should @@ -8057,7 +7670,6 @@ DWORD smb_ServerExceptionFilter(void) { buf_ForceTrace(TRUE); return EXCEPTION_CONTINUE_SEARCH; } -#endif /* * Create a new NCB and associated events, packet buffer, and "space" buffer. @@ -8079,12 +7691,10 @@ void InitNCBslot(int idx) NCBavails[idx] = thrd_CreateEvent(NULL, FALSE, TRUE, eventName); if ( GetLastError() == ERROR_ALREADY_EXISTS ) osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName)); -#ifndef DJGPP sprintf(eventName,"NCBevents[%d]", idx); NCBevents[idx] = thrd_CreateEvent(NULL, TRUE, FALSE, eventName); if ( GetLastError() == ERROR_ALREADY_EXISTS ) osi_Log1(smb_logp, "Event Object Already Exists: %s", osi_LogSaveString(smb_logp, eventName)); -#endif /* !DJGPP */ sprintf(eventName,"NCBReturns[0<=idos_ncb; -#endif /* DJGPP */ /* retrieve computer name */ GetComputerName(cname, &cnamelen); @@ -8142,25 +7745,15 @@ void smb_Listener(void *parmp) ncbp->ncb_lana_num = (UCHAR)lana; -#ifndef DJGPP code = Netbios(ncbp); -#else /* DJGPP */ - code = Netbios(ncbp, dos_ncb); -#endif if (code != 0) { -#ifndef DJGPP char tbuffer[256]; -#endif /* terminate silently if shutdown flag is set */ if (smbShutdownFlag == 1) { -#ifndef DJGPP ExitThread(1); -#else - thrd_Exit(1); -#endif } osi_Log2(smb_logp, @@ -8169,7 +7762,6 @@ void smb_Listener(void *parmp) osi_Log0(smb_logp, "Client exiting due to network failure. Please restart client.\n"); -#ifndef DJGPP sprintf(tbuffer, "Client exiting due to network failure. Please restart client.\n" "NCBLISTEN lana=%d failed with code %d", @@ -8179,14 +7771,6 @@ void smb_Listener(void *parmp) MB_OK|MB_SERVICE_NOTIFICATION); osi_assert(tbuffer); ExitThread(1); -#else - fprintf(stderr, "NCBLISTEN lana=%d failed with code %d\n", - ncbp->ncb_lana_num, code); - fprintf(stderr, "\nClient exiting due to network failure " - "(possibly due to power-saving mode)\n"); - fprintf(stderr, "Please restart client.\n"); - afs_exit(AFS_EXITCODE_NETWORK_FAILURE); -#endif /* !DJGPP */ } /* check for remote conns */ @@ -8226,14 +7810,7 @@ void smb_Listener(void *parmp) ncbp->ncb_lsn,ncbp->ncb_lana_num, osi_LogSaveString(smb_logp, rname), ongoingOps); if (reportSessionStartups) { -#ifndef DJGPP LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SMB_SESSION_START, ongoingOps); -#else /* DJGPP */ - time(&now); - fprintf(stderr, "%s: New session %d starting from host %s\n", - asctime(localtime(&now)), ncbp->ncb_lsn, rname); - fflush(stderr); -#endif /* !DJGPP */ } lock_ObtainMutex(&vcp->mx); @@ -8269,14 +7846,7 @@ void smb_Listener(void *parmp) ncbp->ncb_lsn,ncbp->ncb_lana_num, osi_LogSaveString(smb_logp, rname), ongoingOps); if (reportSessionStartups) { -#ifndef DJGPP LogEvent(EVENTLOG_INFORMATION_TYPE, MSG_SMB_SESSION_START, ongoingOps); -#else /* DJGPP */ - time(&now); - fprintf(stderr, "%s: Re-using session %d starting from host %s\n", - asctime(localtime(&now)), ncbp->ncb_lsn, rname); - fflush(stderr); -#endif /* !DJGPP */ } } @@ -8386,9 +7956,6 @@ void smb_Listener(void *parmp) void smb_NetbiosInit() { NCB *ncbp; -#ifdef DJGPP - dos_ptr dos_ncb; -#endif /* DJGPP */ int i, lana, code, l; char s[100]; int delname_tried=0; @@ -8403,11 +7970,7 @@ void smb_NetbiosInit() /* setup the NCB system */ ncbp = GetNCB(); -#ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; -#endif /* DJGPP */ -#ifndef DJGPP if (smb_LANadapter == -1) { ncbp->ncb_command = NCBENUM; ncbp->ncb_buffer = (PUCHAR)&lana_list; @@ -8441,19 +8004,6 @@ void smb_NetbiosInit() afsi_log("Netbios NCBRESET lana %d succeeded", lana_list.lana[i]); } } -#else - /* for DJGPP, there is no NCBENUM and NCBRESET is a real reset. so - we will just fake the LANA list */ - if (smb_LANadapter == -1) { - for (i = 0; i < 8; i++) - lana_list.lana[i] = i; - lana_list.length = 8; - } - else { - lana_list.length = 1; - lana_list.lana[0] = smb_LANadapter; - } -#endif /* !DJGPP */ /* and declare our name so we can receive connections */ memset(ncbp, 0, sizeof(*ncbp)); @@ -8469,11 +8019,7 @@ void smb_NetbiosInit() ncbp->ncb_command = NCBADDNAME; ncbp->ncb_lana_num = lana; memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ); -#ifndef DJGPP code = Netbios(ncbp); -#else /* DJGPP */ - code = Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ afsi_log("Netbios NCBADDNAME lana=%d code=%d retcode=%d complete=%d", lana, code, ncbp->ncb_retcode, ncbp->ncb_cmd_cplt); @@ -8487,11 +8033,6 @@ void smb_NetbiosInit() if (code == 0) code = ncbp->ncb_retcode; if (code == 0) { afsi_log("Netbios NCBADDNAME succeeded on lana %d\n", lana); -#ifdef DJGPP - /* we only use one LANA with djgpp */ - lana_list.lana[0] = lana; - lana_list.length = 1; -#endif } else { afsi_log("Netbios NCBADDNAME lana %d error code %d", lana, code); @@ -8505,11 +8046,7 @@ void smb_NetbiosInit() ncbp->ncb_command = NCBDELNAME; memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ); ncbp->ncb_lana_num = lana; -#ifndef DJGPP code = Netbios(ncbp); -#else - code = Netbios(ncbp, dos_ncb); -#endif /* DJGPP */ if (code == 0) code = ncbp->ncb_retcode; else { @@ -8534,9 +8071,6 @@ void smb_NetbiosInit() } if (code == 0) { lana_found = 1; /* at least one worked */ -#ifdef DJGPP - break; -#endif } } @@ -8551,9 +8085,7 @@ void smb_NetbiosInit() void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, int nThreads -#ifndef DJGPP , void *aMBfunc -#endif ) { @@ -8562,18 +8094,12 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, INT_PTR i; int len; struct tm myTime; -#ifdef DJGPP - int npar, seg, sel; - dos_ptr rawBuf; -#endif /* DJGPP */ EVENT_HANDLE retHandle; char eventName[MAX_PATH]; smb_TlsRequestSlot = TlsAlloc(); -#ifndef DJGPP smb_MBfunc = aMBfunc; -#endif /* DJGPP */ smb_useV3 = useV3; smb_LANadapter = LANadapt; @@ -8616,7 +8142,6 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, lock_InitializeMutex(&smb_ListenerLock, "smb listener lock"); /* 4 Raw I/O buffers */ -#ifndef DJGPP smb_RawBufs = calloc(65536,1); *((char **)smb_RawBufs) = NULL; for (i=0; i<3; i++) { @@ -8624,39 +8149,6 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, *((char **)rawBuf) = smb_RawBufs; smb_RawBufs = rawBuf; } -#else /* DJGPP */ - npar = 65536 >> 4; /* number of paragraphs */ - seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[0]); - if (seg == -1) { - afsi_log("Cannot allocate %d paragraphs of DOS memory", - npar); - osi_panic("",__FILE__,__LINE__); - } - else { - afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", - npar, seg); - } - smb_RawBufs = (seg * 16) + 0; /* DOS physical address */ - - _farpokel(_dos_ds, smb_RawBufs, NULL); - for (i=0; i> 4; /* number of paragraphs */ - seg = __dpmi_allocate_dos_memory(npar, &smb_RawBufSel[i+1]); - if (seg == -1) { - afsi_log("Cannot allocate %d paragraphs of DOS memory", - npar); - osi_panic("",__FILE__,__LINE__); - } - else { - afsi_log("Allocated %d paragraphs of DOS mem at 0x%X", - npar, seg); - } - rawBuf = (seg * 16) + 0; /* DOS physical address */ - /*_farpokel(_dos_ds, smb_RawBufs, smb_RawBufs);*/ - _farpokel(_dos_ds, rawBuf, smb_RawBufs); - smb_RawBufs = rawBuf; - } -#endif /* !DJGPP */ /* global free lists */ smb_ncbFreeListp = NULL; @@ -8938,12 +8430,10 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, thrd_CloseHandle(phandle); } -#ifndef DJGPP phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter, NULL, 0, &lpid, "smb_ClientWaiter"); osi_assert(phandle != NULL); thrd_CloseHandle(phandle); -#endif /* !DJGPP */ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ServerWaiter, NULL, 0, &lpid, "smb_ServerWaiter"); @@ -8967,19 +8457,12 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt, osi_assert(phandle != NULL); thrd_CloseHandle(phandle); -#ifdef DJGPP - smb_ListShares(); -#endif - return; } void smb_Shutdown(void) { NCB *ncbp; -#ifdef DJGPP - dos_ptr dos_ncb; -#endif long code = 0; int i; smb_vc_t *vcp; @@ -8988,9 +8471,6 @@ void smb_Shutdown(void) /* setup the NCB system */ ncbp = GetNCB(); -#ifdef DJGPP - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; -#endif /* Block new sessions by setting shutdown flag */ smbShutdownFlag = 1; @@ -9006,11 +8486,7 @@ void smb_Shutdown(void) ncbp->ncb_command = NCBHANGUP; ncbp->ncb_lana_num = lanas[i]; /*smb_LANadapter;*/ ncbp->ncb_lsn = (UCHAR)LSNs[i]; -#ifndef DJGPP code = Netbios(ncbp); -#else - code = Netbios(ncbp, dos_ncb); -#endif /*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/ if (code == 0) code = ncbp->ncb_retcode; if (code != 0) { @@ -9044,11 +8520,7 @@ void smb_Shutdown(void) ncbp->ncb_command = NCBDELNAME; ncbp->ncb_lana_num = lana_list.lana[i]; memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ); -#ifndef DJGPP code = Netbios(ncbp); -#else - code = Netbios(ncbp, dos_ncb); -#endif if (code == 0) code = ncbp->ncb_retcode; if (code != 0) { diff --git a/src/WINNT/afsd/smb.h b/src/WINNT/afsd/smb.h index 6f49c52..c4296b2 100644 --- a/src/WINNT/afsd/smb.h +++ b/src/WINNT/afsd/smb.h @@ -10,10 +10,6 @@ #ifndef __SMB_H_ENV__ #define __SMB_H_ENV__ 1 -#ifdef DJGPP -#include "netbios95.h" -#endif /* DJGPP */ - #include /* Support largefiles by default */ @@ -185,10 +181,6 @@ typedef struct smb_packet { unsigned char oddByte; unsigned short ncb_length; unsigned char flags; -#ifdef DJGPP - dos_ptr dos_pkt; - unsigned int dos_pkt_sel; -#endif /* DJGPP */ } smb_packet_t; /* smb_packet flags */ @@ -201,11 +193,6 @@ typedef struct myncb { NCB ncb; /* ncb to use */ struct myncb *nextp; /* when on free list */ long magic; -#ifdef DJGPP - dos_ptr dos_ncb; - smb_packet_t *orig_pkt; - unsigned int dos_ncb_sel; -#endif /* DJGPP */ } smb_ncb_t; /* structures representing environments from kernel / SMB network. @@ -522,9 +509,7 @@ typedef struct smb_dispatch { extern void smb_Init(osi_log_t *logp, char *smbNamep, int useV3, int LANadapt, int nThreads -#ifndef DJGPP , void *aMBfunc -#endif ); extern void smb_LargeSearchTimeFromUnixTime(FILETIME *largeTimep, time_t unixTime); @@ -714,21 +699,11 @@ extern unsigned char *smb_ParseVblBlock(unsigned char *inp, char **chainpp, int extern int smb_SUser(cm_user_t *userp); -#ifndef DJGPP long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, cm_user_t *userp, long *writtenp); -#else /* DJGPP */ -long smb_WriteData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, - cm_user_t *userp, long *writtenp, int dosflag); -#endif /* !DJGPP */ -#ifndef DJGPP extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, char *op, cm_user_t *userp, long *readp); -#else /* DJGPP */ -extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count, - char *op, cm_user_t *userp, long *readp, int dosflag); -#endif /* !DJGPP */ extern long smb_Rename(smb_vc_t *vcp, smb_packet_t *inp, char *oldPathp, char *newPathp, int attrs); diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 5ef1840..cf30616 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -10,13 +10,11 @@ #include #include -#ifndef DJGPP #include #include #define SECURITY_WIN32 #include #include -#endif /* !DJGPP */ #include #include #include @@ -1317,9 +1315,7 @@ long smb_ReceiveV3Trans(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) /* We sometimes see 0 word count. What to do? */ if (*inp->wctp == 0) { osi_Log0(smb_logp, "Transaction2 word count = 0"); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_SMB_ZERO_TRANSACTION_COUNT); -#endif /* !DJGPP */ smb_SetSMBDataLength(outp, 0); smb_SendPacket(vcp, outp); @@ -1944,9 +1940,7 @@ long smb_ReceiveV3Tran2A(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) /* We sometimes see 0 word count. What to do? */ if (*inp->wctp == 0) { osi_Log0(smb_logp, "Transaction2 word count = 0"); -#ifndef DJGPP LogEvent(EVENTLOG_WARNING_TYPE, MSG_SMB_ZERO_TRANSACTION_COUNT); -#endif /* !DJGPP */ smb_SetSMBDataLength(outp, 0); smb_SendPacket(vcp, outp); @@ -5673,11 +5667,7 @@ long smb_ReceiveV3WriteX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) code = 0; while ( code == 0 && count > 0 ) { -#ifndef DJGPP code = smb_WriteData(fidp, &offset, count, op, userp, &written); -#else /* DJGPP */ - code = smb_WriteData(fidp, &offset, count, op, userp, &written, FALSE); -#endif /* !DJGPP */ if (code == 0 && written == 0) code = CM_ERROR_PARTIALWRITE; @@ -5812,11 +5802,7 @@ long smb_ReceiveV3ReadX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) /* set the packet data length the count of the # of bytes */ smb_SetSMBDataLength(outp, count); -#ifndef DJGPP code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount); -#else /* DJGPP */ - code = smb_ReadData(fidp, &offset, count, op, userp, &finalCount, FALSE); -#endif /* !DJGPP */ /* fix some things up */ smb_SetSMBParm(outp, 5, finalCount); diff --git a/src/WINNT/afsd/smb3.h b/src/WINNT/afsd/smb3.h index 813c33a..836fe40 100644 --- a/src/WINNT/afsd/smb3.h +++ b/src/WINNT/afsd/smb3.h @@ -326,14 +326,4 @@ extern cm_user_t *smb_FindCMUserByName(char *usern, char *machine, afs_uint32 fl /* SMB auth related functions */ extern void smb_NegotiateExtendedSecurity(void ** secBlob, int * secBlobLength); -#ifdef DJGPP -#define DELETE (0x00010000) -#define READ_CONTROL (0x00020000) -#define SYNCHRONIZE (0x00100000) -#define FILE_WRITE_ATTRIBUTES ( 0x0100 ) -#define FILE_GENERIC_READ (0x00120089) -#define FILE_GENERIC_WRITE (0x00120116) -#define FILE_GENERIC_EXECUTE (0x001200a0) -#endif /* DJGPP */ - #endif /* __SMB3_H_ENV__ */ diff --git a/src/WINNT/afsd/smb_ioctl.c b/src/WINNT/afsd/smb_ioctl.c index 7f30883..aa44d8f 100644 --- a/src/WINNT/afsd/smb_ioctl.c +++ b/src/WINNT/afsd/smb_ioctl.c @@ -10,9 +10,7 @@ #include #include -#ifndef DJGPP #include -#endif /* !DJGPP */ #include #include #include @@ -73,9 +71,6 @@ void smb_InitIoctl(void) smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt; smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt; smb_ioctlProcsp[VIOC_ISSYMLINK] = cm_IoctlIslink; -#ifdef DJGPP - smb_ioctlProcsp[VIOC_SHUTDOWN] = cm_IoctlShutdown; -#endif smb_ioctlProcsp[VIOC_TRACEMEMDUMP] = cm_IoctlMemoryDump; smb_ioctlProcsp[VIOC_ISSYMLINK] = cm_IoctlIslink; smb_ioctlProcsp[VIOC_FLUSHALL] = cm_IoctlFlushAllVolumes; @@ -414,9 +409,6 @@ long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_pack /* called from Read Raw to handle IOCTL descriptor reads */ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp -#ifdef DJGPP - , dos_ptr rawBuf -#endif /* DJGPP */ ) { smb_ioctl_t *iop; @@ -424,15 +416,6 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, NCB *ncbp; long code; cm_user_t *userp; -#ifdef DJGPP - dos_ptr dos_ncb; - - if (rawBuf == 0) - { - osi_Log0(afsd_logp, "Failed to get raw buf for smb_IoctlReadRaw"); - return -1; - } -#endif /* DJGPP */ iop = fidp->ioctlp; @@ -481,15 +464,8 @@ long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, /*ncbp->ncb_lana_num = smb_LANadapter;*/ ncbp->ncb_lana_num = vcp->lana; -#ifndef DJGPP ncbp->ncb_buffer = iop->outCopied + iop->outAllocp; code = Netbios(ncbp); -#else /* DJGPP */ - dosmemput(iop->outCopied + iop->outAllocp, ncbp->ncb_length, rawBuf); - ncbp->ncb_buffer = rawBuf; - dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb; - code = Netbios(ncbp, dos_ncb); -#endif /* !DJGPP */ if (code != 0) osi_Log1(afsd_logp, "ReadRaw send failure code %d", code); diff --git a/src/WINNT/afsd/smb_ioctl.h b/src/WINNT/afsd/smb_ioctl.h index bb5ffb0..14e35f1 100644 --- a/src/WINNT/afsd/smb_ioctl.h +++ b/src/WINNT/afsd/smb_ioctl.h @@ -34,12 +34,7 @@ extern long smb_IoctlV3Write(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, extern long smb_IoctlV3Read(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp); -#ifndef DJGPP extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp); -#else /* DJGPP */ -extern long smb_IoctlReadRaw(smb_fid_t *fidp, smb_vc_t *vcp, smb_packet_t *inp, - smb_packet_t *outp, dos_ptr rawBuf); -#endif /* !DJGPP */ #endif /* __SMB_IOCTL_H_ENV__ */ diff --git a/src/WINNT/client_osi/osi.h b/src/WINNT/client_osi/osi.h index 071533e..6ecacc2 100644 --- a/src/WINNT/client_osi/osi.h +++ b/src/WINNT/client_osi/osi.h @@ -17,15 +17,11 @@ /* misc definitions */ /* large int */ -#ifndef DJGPP #include #if !defined(_MSC_VER) || (_MSC_VER < 1300) #include "largeint.h" #endif #include "osithrdnt.h" -#else /* DJGPP */ -#include "largeint95.h" -#endif /* !DJGPP */ typedef LARGE_INTEGER osi_hyper_t; #if _MSC_VER >= 1300 @@ -59,15 +55,10 @@ LARGE_INTEGER ConvertLongToLargeInteger(unsigned long a); #define LargeIntegerNotEqualToZero(a) ((a).HighPart || (a).LowPart) #endif -#ifndef DJGPP typedef GUID osi_uid_t; -#else /* DJGPP */ -typedef int osi_uid_t; -#endif /* !DJGPP */ typedef int int32; -#ifndef DJGPP /* basic util functions */ #include "osiutils.h" @@ -76,12 +67,10 @@ typedef int int32; /* lock type definitions */ #include "osiltype.h" -#endif /* !DJGPP */ /* basic sleep operations */ #include "osisleep.h" -#ifndef DJGPP /* base lock definitions */ #include "osibasel.h" @@ -90,9 +79,6 @@ typedef int int32; /* RPC debug stuff */ #include "osidb.h" -#else /* DJGPP */ -#include "osithrd95.h" -#endif /* !DJGPP */ /* log stuff */ #include "osilog.h" diff --git a/src/WINNT/client_osi/osifd.c b/src/WINNT/client_osi/osifd.c index e5ab641..07bf73c 100644 --- a/src/WINNT/client_osi/osifd.c +++ b/src/WINNT/client_osi/osifd.c @@ -13,11 +13,9 @@ #include #include -#ifndef DJGPP #include #include #include "dbrpc.h" -#endif /* !DJGPP */ #include #include "osi.h" #include @@ -29,9 +27,7 @@ long osi_nextFD = 0; osi_fdOps_t osi_TypeFDOps = { osi_FDTypeCreate, -#ifndef DJGPP osi_FDTypeGetInfo, -#endif osi_FDTypeClose }; @@ -216,7 +212,6 @@ long osi_FDTypeCreate(osi_fdType_t *fdTypep, osi_fd_t **outpp) } -#ifndef DJGPP long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp) { osi_typeFD_t *fdp; @@ -239,7 +234,6 @@ long osi_FDTypeGetInfo(osi_fd_t *ifdp, osi_remGetInfoParms_t *outp) return OSI_DBRPC_EOF; } } -#endif /* !DJGPP */ long osi_FDTypeClose(osi_fd_t *ifdp) { diff --git a/src/WINNT/client_osi/osifd.h b/src/WINNT/client_osi/osifd.h index f9822f5..0296616 100644 --- a/src/WINNT/client_osi/osifd.h +++ b/src/WINNT/client_osi/osifd.h @@ -12,9 +12,7 @@ #ifndef _OSIFD_H_ENV_ #define _OSIFD_H_ENV_ 1 -#ifndef DJGPP #include "dbrpc.h" -#endif /* !DJGPP */ #include "osiqueue.h" struct osi_fd; @@ -28,12 +26,10 @@ typedef struct osi_fdOps { */ long (*Create)(struct osi_fdType *, struct osi_fd **); -#ifndef DJGPP /* gets info about the object; fields are type specific, and eventually * self-labelling */ long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *); -#endif /* close an object; frees the storage associated with it */ long (*Close)(struct osi_fd *); @@ -92,9 +88,7 @@ extern int osi_CloseFD(osi_fd_t *); extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **); -#ifndef DJGPP extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *); -#endif extern long osi_FDTypeClose(osi_fd_t *); diff --git a/src/WINNT/client_osi/osilog.c b/src/WINNT/client_osi/osilog.c index 7466b66..ed6fa7d 100644 --- a/src/WINNT/client_osi/osilog.c +++ b/src/WINNT/client_osi/osilog.c @@ -12,15 +12,11 @@ #include #include -#ifndef DJGPP #include #include -#endif /* !DJGPP */ #include #include "osi.h" -#ifndef DJGPP #include "dbrpc.h" -#endif /* !DJGPP */ #include #include #include @@ -47,9 +43,7 @@ DWORD osi_TraceOption=0; osi_fdOps_t osi_logFDOps = { osi_LogFDCreate, -#ifndef DJGPP osi_LogFDGetInfo, -#endif osi_LogFDClose }; @@ -63,7 +57,6 @@ osi_log_t *osi_LogCreate(char *namep, long size) LARGE_INTEGER bigTemp; LARGE_INTEGER bigJunk; -#ifndef DJGPP if (osi_Once(&osi_logOnce)) { QueryPerformanceFrequency(&bigFreq); if (bigFreq.LowPart == 0 && bigFreq.HighPart == 0) @@ -85,7 +78,6 @@ osi_log_t *osi_LogCreate(char *namep, long size) /* done with init */ osi_EndOnce(&osi_logOnce); } -#endif /* !DJGPP */ logp = malloc(sizeof(osi_log_t)); memset(logp, 0, sizeof(osi_log_t)); @@ -112,7 +104,6 @@ osi_log_t *osi_LogCreate(char *namep, long size) strcpy(tbuffer, "log:"); strcat(tbuffer, namep); typep = osi_RegisterFDType(tbuffer, &osi_logFDOps, logp); -#ifndef DJGPP if (typep) { /* add formatting info */ osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONINT, 0, @@ -120,7 +111,6 @@ osi_log_t *osi_LogCreate(char *namep, long size) osi_AddFDFormatInfo(typep, OSI_DBRPC_REGIONSTRING, 1, "Time (mics)", 0); } -#endif return logp; } @@ -199,15 +189,11 @@ void osi_LogAdd(osi_log_t *logp, char *formatp, size_t p0, size_t p1, size_t p2, lep->tid = thrd_Current(); /* get the time, using the high res timer if available */ -#ifndef DJGPP if (osi_logFreq) { QueryPerformanceCounter(&bigTime); lep->micros = (bigTime.LowPart / osi_logFreq) * osi_logTixToMicros; } else lep->micros = GetCurrentTime() * 1000; -#else - lep->micros = gettime_us(); -#endif /* !DJGPP */ lep->formatp = formatp; lep->parms[0] = p0; @@ -257,12 +243,8 @@ void osi_LogPrint(osi_log_t *logp, FILE_HANDLE handle) lep->micros / 1000000, lep->micros % 1000000, lep->tid, msg); -#ifndef DJGPP if (!WriteFile(handle, wholemsg, strlen(wholemsg), &ioCount, NULL)) -#else /* DJGPP */ - if ((ioCount = fwrite(wholemsg, 1, strlen(wholemsg), handle)) == 0) -#endif /* !DJGPP */ break; } @@ -311,7 +293,6 @@ long osi_LogFDCreate(osi_fdType_t *typep, osi_fd_t **outpp) return 0; } -#ifndef DJGPP long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp) { osi_logFD_t *lfdp; @@ -349,7 +330,6 @@ long osi_LogFDGetInfo(osi_fd_t *ifd, osi_remGetInfoParms_t *outp) thrd_LeaveCrit(&logp->cs); return 0; } -#endif /* !DJGPP */ long osi_LogFDClose(osi_fd_t *ifdp) { diff --git a/src/WINNT/client_osi/osilog.h b/src/WINNT/client_osi/osilog.h index 3c4e43f..8677da3 100644 --- a/src/WINNT/client_osi/osilog.h +++ b/src/WINNT/client_osi/osilog.h @@ -10,11 +10,9 @@ #define _OSI_LOG_H__ 1 #include "osi.h" -#ifndef DJGPP #include "osisleep.h" #include "osibasel.h" #include "osistatl.h" -#endif /* !DJGPP */ #include "osifd.h" #include "osiqueue.h" @@ -65,9 +63,7 @@ extern void osi_LogReset(osi_log_t *); extern long osi_LogFDCreate(osi_fdType_t *, osi_fd_t **); -#ifndef DJGPP extern long osi_LogFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *); -#endif extern long osi_LogFDClose(osi_fd_t *); diff --git a/src/WINNT/client_osi/osiqueue.c b/src/WINNT/client_osi/osiqueue.c index b4bce19..fed32c3 100644 --- a/src/WINNT/client_osi/osiqueue.c +++ b/src/WINNT/client_osi/osiqueue.c @@ -12,9 +12,7 @@ #include #include -#ifndef DJGPP #include -#endif /* !DJGPP */ #include "osi.h" #include diff --git a/src/WINNT/client_osi/osisleep.h b/src/WINNT/client_osi/osisleep.h index 3467eea..b38b71b 100644 --- a/src/WINNT/client_osi/osisleep.h +++ b/src/WINNT/client_osi/osisleep.h @@ -15,9 +15,6 @@ /*#include "osi.h"*/ #include "osifd.h" #include "osiqueue.h" -#ifdef DJGPP -#include "osithrd95.h" -#endif /* DJGPP */ /* states bits */ #define OSI_SLEEPINFO_SIGNALLED 1 /* this sleep structure has been signalled */ @@ -52,11 +49,7 @@ typedef struct osi_sleepFD{ /* struct for single-shot initialization support */ typedef struct osi_once { -#ifndef DJGPP long atomic; /* used for atomicity */ -#else - osi_mutex_t atomic; /* used for atomicity */ -#endif /* !DJGPP */ int done; /* tells if initialization is done */ } osi_once_t; @@ -83,10 +76,8 @@ extern void osi_SleepSpin(LONG_PTR value, Crit_Sec *counterp); /* spin lock version of wakeup, used internally only */ extern void osi_WakeupSpin(LONG_PTR value); -#ifndef DJGPP /* exported function to sleep on a value */ extern void osi_Sleep (LONG_PTR); -#endif extern void osi_FreeSleepInfo(osi_sleepInfo_t *); @@ -111,12 +102,10 @@ extern int osi_TestOnce(osi_once_t *); extern void osi_EndOnce(osi_once_t *); -#ifndef DJGPP /* exported function to wakeup those sleeping on a value */ extern void osi_Wakeup (LONG_PTR); extern void osi_Init (void); -#endif /* !DJGPP */ /* create a ptr to a cookie */ osi_sleepFD_t *osi_CreateSleepCookie(void); @@ -129,9 +118,7 @@ int osi_NextSleepCookie(osi_sleepFD_t *); /* functions for the sleep FD implementation */ extern long osi_SleepFDCreate(osi_fdType_t *, osi_fd_t **); -#ifndef DJGPP extern long osi_SleepFDGetInfo(osi_fd_t *, osi_remGetInfoParms_t *); -#endif extern long osi_SleepFDClose(osi_fd_t *); /* functions for getting hash sizes */ diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index f9e5bfd..5850209 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -54,7 +54,7 @@ #endif #else /* AFS_XBSD_ENV */ -#if defined(AFS_LINUX20_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_LINUX20_ENV) #ifdef AFS_PARISC_LINUX20_ENV #include "conf-parisc-linux.h" #else diff --git a/src/des/new_rnd_key.c b/src/des/new_rnd_key.c index 91a4b60..00ee6e5 100644 --- a/src/des/new_rnd_key.c +++ b/src/des/new_rnd_key.c @@ -101,7 +101,7 @@ des_random_key(des_cblock key) * * Note: this routine calls des_set_random_generator_seed. */ -#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) you lose ... (aka, you get to implement an analog of this for your system ...) #else @@ -129,7 +129,7 @@ des_init_random_number_generator(des_cblock key) * use a host id and process id in generating the seed to ensure * that different servers have different streams: */ -#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) seed.host_id = gethostid(); #endif seed.process_id = getpid(); diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c index d240103..57d36cd 100644 --- a/src/lwp/iomgr.c +++ b/src/lwp/iomgr.c @@ -61,16 +61,6 @@ extern void lwp_abort(void); #ifdef AFS_SUN5_ENV #include #endif -#ifdef AFS_DJGPP_ENV -#include "dosdefs95.h" -#include "netbios95.h" -#include -#include -#include -#include -#include -int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY; -#endif /* AFS_DJGPP_ENV */ #if defined(USE_PTHREADS) || defined(USE_SOLARIS_THREADS) @@ -133,13 +123,8 @@ struct IoRequest { struct IoRequest *next; /* for iorFreeList */ -#ifdef AFS_DJGPP_ENV - NCB *ncbp; - dos_ptr dos_ncb; -#endif /* AFS_DJGPP_ENV */ - }; - + /********************************\ * * * Stuff for managing signals * @@ -180,15 +165,6 @@ static void SignalIO(int fds, fd_set *rfds, fd_set *wfds, fd_set *efs, int code); static void SignalTimeout(int code, struct timeval *timeout); -#ifdef AFS_DJGPP_ENV -/* handle Netbios NCB completion */ -static int NCB_fd; -int anyNCBComplete = FALSE; -int handler_seg, handler_off; /* seg:off of NCB completion handler */ -static __dpmi_regs callback_regs; -static _go32_dpmi_seginfo callback_info; -#endif /* AFS_DJGPP_ENV */ - /* fd_set pool managment. * Use the pool instead of creating fd_set's on the stack. fd_set's can be * 8K in size, so making three could put 24K in the limited space of an LWP @@ -437,9 +413,7 @@ static int IOMGR(void *dummy) /* Note: SignalSignals() may yield! */ if (anySigsDelivered && SignalSignals ()) woke_someone = TRUE; -#ifndef AFS_DJGPP_ENV FT_GetTimeOfDay(&junk, 0); /* force accurate time check */ -#endif TM_Rescan(Requests); for (;;) { register struct IoRequest *req; @@ -466,11 +440,6 @@ static int IOMGR(void *dummy) req->pid->iomgrRequest = 0; } -#ifdef AFS_DJGPP_ENV - if (IOMGR_CheckNCB()) /* check for completed netbios requests */ - woke_someone = TRUE; -#endif /* AFS_DJGPP_ENV */ - if (woke_someone) LWP_DispatchProcess(); } while (woke_someone); @@ -552,14 +521,6 @@ static int IOMGR(void *dummy) } #endif /* NT40 */ -#ifdef AFS_DJGPP_ENV - /* We do this also for the DOS-box Win95 client, since - NCB calls don't interrupt a select, but we want to catch them - in a reasonable amount of time (say, half a second). */ - iomgr_timeout.tv_sec = 0; - iomgr_timeout.tv_usec = IOMGR_WIN95WAITTIME; -#endif /* DJGPP */ - /* Check one last time for a signal delivery. If one comes after this, the signal handler will set iomgr_timeout to zero, causing the select to return immediately. The timer package won't return @@ -570,11 +531,6 @@ static int IOMGR(void *dummy) if (anySigsDelivered) continue; /* go to the top and handle them. */ -#ifdef AFS_DJGPP_ENV - if (IOMGR_CheckNCB()) /* check for completed netbios requests */ - LWP_DispatchProcess(); -#endif /* AFS_DJGPP_ENV */ - #ifdef AFS_NT40_ENV if (IOMGR_readfds.fd_count == 0 && IOMGR_writefds.fd_count == 0 && IOMGR_exceptfds.fd_count == 0) { @@ -658,14 +614,9 @@ static int IOMGR(void *dummy) continue; } #endif /* AFS_NT40_ENV */ -#ifndef AFS_DJGPP_ENV FT_GetTimeOfDay(&junk, 0); -#endif SignalTimeout(code, &timeout); } -#ifdef AFS_DJGPP_ENV - IOMGR_CheckNCB(); -#endif /* AFS_DJGPP_ENV */ } LWP_DispatchProcess(); } @@ -821,10 +772,6 @@ int IOMGR_Initialize(void) IOMGR_Initialize: so force a check for signals regardless */ memset(allOnes, 0xff, sizeof(allOnes)); -#ifdef AFS_DJGPP_ENV - install_ncb_handler(); -#endif /* AFS_DJGPP_ENV */ - return LWP_CreateProcess(IOMGR, AFS_LWP_MINSTACKSIZE, 0, (void *) 0, "IO MANAGER", &IOMGR_Id); } @@ -1073,171 +1020,10 @@ int IOMGR_CancelSignal (int signo) /* This routine calls select is a fashion that simulates the standard sleep routine */ void IOMGR_Sleep (int seconds) { -#ifndef AFS_DJGPP_ENV struct timeval timeout; timeout.tv_sec = seconds; timeout.tv_usec = 0; IOMGR_Select(0, 0, 0, 0, &timeout); -#else - struct timeval timeout; - int s; - fd_set set, empty; - FD_ZERO(&empty); - FD_ZERO(&set); - s = socket(AF_INET,SOCK_STREAM,0); - FD_SET(s,&set); - - timeout.tv_sec = seconds; - timeout.tv_usec = 0; - IOMGR_Select(1,&set,&empty,&empty,&timeout); - close(s); -#endif /* DJGPP */ } #endif /* USE_PTHREADS */ - - -#ifdef AFS_DJGPP_ENV - -/* Netbios code for djgpp port */ - -int IOMGR_NCBSelect(NCB *ncbp, dos_ptr dos_ncb, struct timeval *timeout) -{ - struct IoRequest *request; - int result; - - if (timeout != NULL && timeout->tv_sec == 0 && timeout->tv_usec == 0) - { - /* Poll */ - if (ncbp->ncb_event != NULL) - { - /* error */ - return -1; - } - - if (get_dos_member_b(NCB, dos_ncb, ncb_cmd_cplt) != 0xff) - { - return 1; - } - else { - return 0; - } - } - - /* Construct request block & insert */ - request = NewRequest(); - request->ncbp = ncbp; - request->dos_ncb = dos_ncb; - - if (timeout == NULL) - { - request->timeout.TotalTime.tv_sec = -1; - request->timeout.TotalTime.tv_usec = -1; - } - else - { - request -> timeout.TotalTime = *timeout; - /* check for bad request */ - if (timeout->tv_sec < 0 || timeout->tv_usec < 0 || timeout->tv_usec > 999999) - { - /* invalid arg */ - iomgr_badtv = *timeout; - iomgr_badpid = LWP_ActiveProcess; - /* now fixup request */ - if(request->timeout.TotalTime.tv_sec < 0) - request->timeout.TotalTime.tv_sec = 1; - request->timeout.TotalTime.tv_usec = 100000; - } - } - - request->timeout.BackPointer = (char *)request; - - /* Insert my PID in case of IOMGR_Cancel */ - request -> pid = LWP_ActiveProcess; - LWP_ActiveProcess -> iomgrRequest = request; - -#ifdef DEBUG - request -> timeout.Next = (struct TM_Elem *) 1; - request -> timeout.Prev = (struct TM_Elem *) 1; -#endif /* DEBUG */ - TM_Insert(Requests, &request->timeout); - - if (ncbp->ncb_event != NULL) - { - /* since we were given an event, we can return immediately and just - signal the event once the request completes. */ - return 0; - } - else - { - /* Wait for action */ - - LWP_QWait(); - - /* Update parameters & return */ - result = request -> result; - - FreeRequest(request); - return (result > 1 ? 1 : result); - } -} - -int IOMGR_CheckNCB(void) -{ - int woke_someone = FALSE; - EVENT_HANDLE ev; - PROCESS pid; - - anyNCBComplete = FALSE; - FOR_ALL_ELTS(r, Requests, { - register struct IoRequest *req; - req = (struct IoRequest *) r -> BackPointer; - - if (req->dos_ncb && get_dos_member_b(NCB, req->dos_ncb, ncb_cmd_cplt) != 0xff) - { - /* this NCB has completed */ - TM_Remove(Requests, &req->timeout); - - /* copy out NCB from DOS to virtual space */ - dosmemget(req->dos_ncb, sizeof(NCB), (char *) req->ncbp); - - if (ev = req->ncbp->ncb_event) - { - thrd_SetEvent(ev); - } - else - { - woke_someone = TRUE; - LWP_QSignal(pid=req->pid); - pid->iomgrRequest = 0; - } - } - }) - return woke_someone; -} - -int ncb_handler(__dpmi_regs *r) -{ - anyNCBComplete = TRUE; /* NCB completed */ - /* Make sure that the IOMGR process doesn't pause on the select. */ - iomgr_timeout.tv_sec = 0; - iomgr_timeout.tv_usec = 0; - return; -} - -int install_ncb_handler(void) -{ - callback_info.pm_offset = (long) ncb_handler; - if (_go32_dpmi_allocate_real_mode_callback_retf(&callback_info, - &callback_regs)) - { - fprintf(stderr, "error, allocate_real_mode_callback_retf failed\n"); - return -1; - } - - handler_seg = callback_info.rm_segment; - handler_off = callback_info.rm_offset; - - /*printf("NCB handler_seg=0x%x, off=0x%x\n", handler_seg, handler_off);*/ -} -#endif /* AFS_DJGPP_ENV */ diff --git a/src/lwp/preempt.c b/src/lwp/preempt.c index 1e63e05..cf97909 100644 --- a/src/lwp/preempt.c +++ b/src/lwp/preempt.c @@ -23,7 +23,7 @@ RCSID #include "lwp.h" #include "preempt.h" -#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) int PRE_Block = 0; diff --git a/src/lwp/process.s b/src/lwp/process.s index 586c272..92b7e70 100644 --- a/src/lwp/process.s +++ b/src/lwp/process.s @@ -8,9 +8,7 @@ */ #define IGNORE_STDS_H 1 -/*#ifndef AFS_DJGPP_ENV*/ #include -/*#endif /* AFS_DJGPP_ENV */ #if defined(RIOS) diff --git a/src/lwp/timer.c b/src/lwp/timer.c index cdc2285..da10d0b 100644 --- a/src/lwp/timer.c +++ b/src/lwp/timer.c @@ -212,11 +212,7 @@ TM_Rescan(struct TM_Elem *tlist) /* head pointer of timer list */ struct timeval time; register int expired; -#ifndef AFS_DJGPP_ENV FT_AGetTimeOfDay(&time, 0); -#else - FT_GetTimeOfDay(&time, 0); /* we need a real time value */ -#endif expired = 0; FOR_ALL_ELTS(e, tlist, { if (!blocking(e)) { diff --git a/src/lwp/waitkey.c b/src/lwp/waitkey.c index e31e0c5..af7ca81 100644 --- a/src/lwp/waitkey.c +++ b/src/lwp/waitkey.c @@ -166,7 +166,6 @@ LWP_WaitForKeystroke(int seconds) struct timeval twait; struct timeval *tp = NULL; -#ifndef AFS_DJGPP_ENV #ifdef AFS_LINUX20_ENV if (stdin->_IO_read_ptr < stdin->_IO_read_end) return 1; @@ -179,10 +178,6 @@ LWP_WaitForKeystroke(int seconds) return 1; #endif #endif -#else /* DJGPP */ - if (stdin->_cnt > 0) - return 1; -#endif /* DJGPP */ FD_ZERO(&rdfds); FD_SET(fileno(stdin), &rdfds); diff --git a/src/rx/rx.c b/src/rx/rx.c index 436c731..7a1efaf 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -423,10 +423,6 @@ int rx_InitAddrs(struct sockaddr_storage *saddrs, int *types, int *salens, char *htable, *ptable; int tmp_status, i; -#if defined(AFS_DJGPP_ENV) && !defined(DEBUG) - __djgpp_set_quiet_socket(1); -#endif - SPLVAR; INIT_PTHREAD_LOCKS; diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 3f53907..f8279f9 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -13,7 +13,6 @@ RCSID ("$Header$"); -#ifndef AFS_DJGPP_ENV #ifndef KERNEL #ifndef AFS_NT40_ENV #include @@ -522,5 +521,3 @@ rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[], #endif /* ! AFS_NT40_ENV */ #endif /* !KERNEL || UKERNEL */ - -#endif /* !AFS_DJGPP_ENV */ diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index 51c923d..40b01db 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -393,19 +393,11 @@ rxi_Listen(osi_socket sock) * Put the socket into non-blocking mode so that rx_Listener * can do a polling read before entering select */ -#ifndef AFS_DJGPP_ENV if (fcntl(sock, F_SETFL, FNDELAY) == -1) { perror("fcntl"); (osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n"); return -1; } -#else - if (__djgpp_set_socket_blocking_mode(sock, 1) < 0) { - perror("__djgpp_set_socket_blocking_mode"); - (osi_Msg "rxi_Listen: unable to set non-blocking mode on socket\n"); - return -1; - } -#endif /* AFS_DJGPP_ENV */ if (sock > FD_SETSIZE - 1) { (osi_Msg "rxi_Listen: socket descriptor > (FD_SETSIZE-1) = %d\n", diff --git a/src/rx/rx_misc.c b/src/rx/rx_misc.c index 4b9761d..69ddc5b 100644 --- a/src/rx/rx_misc.c +++ b/src/rx/rx_misc.c @@ -59,7 +59,7 @@ hton_syserr_conv(register afs_int32 code) if (code == ENOSPC) err = VDISKFULL; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_NT40_ENV) /* EDQUOT doesn't exist on solaris */ else if (code == EDQUOT) err = VOVERQUOTA; @@ -82,7 +82,7 @@ ntoh_syserr_conv(int code) if (code == VDISKFULL) err = ENOSPC; else if (code == VOVERQUOTA) -#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) err = ENOSPC; #else err = EDQUOT; diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 7028e8d..83aafb5 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -61,7 +61,7 @@ RCSID #include "sys/types.h" #include #include -#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_NT40_ENV) #ifdef AFS_NT40_ENV #include #ifndef EWOULDBLOCK diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h index 61f1680..36b391c 100644 --- a/src/rx/rx_packet.h +++ b/src/rx/rx_packet.h @@ -10,7 +10,7 @@ #ifndef _RX_PACKET_ #define _RX_PACKET_ #ifndef UKERNEL -#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_NT40_ENV) #include "rx_xmit_nt.h" #endif #ifndef AFS_NT40_ENV @@ -33,7 +33,7 @@ */ -#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_NT40_ENV) #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c index 94c4569..424a8e5 100644 --- a/src/rx/rx_user.c +++ b/src/rx/rx_user.c @@ -31,7 +31,7 @@ RCSID # include #endif # include -#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) # include #endif #include @@ -104,7 +104,7 @@ rxi_GetHostUDPSocket(struct sockaddr_storage *saddr, int salen) #endif #if 0 -#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_NT40_ENV) if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) { /* (osi_Msg "%s*WARNING* port number %d is not a reserved port number. Use port numbers above %d\n", name, port, IPPORT_USERRESERVED); */ ; @@ -137,14 +137,13 @@ rxi_GetHostUDPSocket(struct sockaddr_storage *saddr, int salen) (osi_Msg "%sbind failed\n", name); goto error; } -#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_NT40_ENV) /* * Set close-on-exec on rx socket */ fcntl(socketFd, F_SETFD, 1); #endif -#ifndef AFS_DJGPP_ENV /* Use one of three different ways of getting a socket buffer expanded to * a reasonable size. */ @@ -177,7 +176,6 @@ rxi_GetHostUDPSocket(struct sockaddr_storage *saddr, int salen) rx_stats.socketGreedy = greedy; MUTEX_EXIT(&rx_stats_mutex); } -#endif /* AFS_DJGPP_ENV */ #ifdef AFS_LINUX22_ENV setsockopt(socketFd, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu)); @@ -273,7 +271,7 @@ static int myNetFlags[ADDRSPERSITE]; static u_int rxi_numNetAddrs; static int Inited = 0; -#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_NT40_ENV) int rxi_getaddr(void) { @@ -375,7 +373,7 @@ fudge_netmask(afs_uint32 addr) -#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) int rxi_syscall(a3, a4, a5) afs_uint32 a3, a4; @@ -404,7 +402,6 @@ rx_GetIFInfo(void) { int s; int i, j, len, res; -#ifndef AFS_DJGPP_ENV struct ifconf ifc; struct ifreq ifs[ADDRSPERSITE]; struct ifreq *ifr; @@ -412,7 +409,6 @@ rx_GetIFInfo(void) char buf[BUFSIZ], *cp, *cplim; #endif struct sockaddr_in *a; -#endif /* AFS_DJGPP_ENV */ LOCK_IF_INIT; if (Inited) { @@ -432,7 +428,6 @@ rx_GetIFInfo(void) if (s < 0) return; -#ifndef AFS_DJGPP_ENV #ifdef AFS_AIX41_ENV ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; @@ -600,10 +595,6 @@ rx_GetIFInfo(void) rxi_MorePackets(npackets * (ncbufs + 1)); } } -#else /* AFS_DJGPP_ENV */ - close(s); - return; -#endif /* AFS_DJGPP_ENV */ } #endif /* AFS_NT40_ENV */ diff --git a/src/rx/rx_xmit_nt.c b/src/rx/rx_xmit_nt.c index 53129b7..63b02a6 100644 --- a/src/rx/rx_xmit_nt.c +++ b/src/rx/rx_xmit_nt.c @@ -20,20 +20,9 @@ RCSID ("$Header$"); -#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) +#if defined(AFS_NT40_ENV) -#ifdef AFS_NT40_ENV #include -#else -#include -#include -#include -#include -#include -#include -#include -typedef int SOCKET; -#endif #include "rx.h" #include "rx_packet.h" @@ -159,4 +148,4 @@ sendmsg(osi_socket socket, struct msghdr *msgP, int flags) return code; } -#endif /* AFS_NT40_ENV || AFS_DJGPP_ENV */ +#endif /* AFS_NT40_ENV */ diff --git a/src/rx/rx_xmit_nt.h b/src/rx/rx_xmit_nt.h index 7f6e1da..7ffc26e 100644 --- a/src/rx/rx_xmit_nt.h +++ b/src/rx/rx_xmit_nt.h @@ -12,12 +12,10 @@ typedef struct iovec -#ifndef AFS_DJGPP_ENV { void *iov_base; int iov_len; } -#endif iovec_t; struct msghdr { diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 2800867..d224d5a 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -312,7 +312,7 @@ main(argc, argv) } memcpy(&myHost, th->h_addr, sizeof(afs_int32)); -#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) +#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) signal(SIGXCPU, CheckSignal_Signal); #endif /* get list of servers */ -- 1.9.4