Changeset 372 for branches


Ignore:
Timestamp:
Jan 15, 2010, 1:16:04 PM (16 years ago)
Author:
Silvan Scherrer
Message:

remove hardcoded path, remove some files

Location:
branches/samba-3.3.x/source
Files:
1 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/Makefile.in

    r370 r372  
    332332          lib/interface.o lib/md4.o \
    333333          lib/pidfile.o \
    334           lib/signal.o lib/system.o lib/os2ea.o lib/sendfile.o lib/recvfile.o lib/time.o \
     334          lib/signal.o lib/system.o lib/os2ea.o lib/os2path.o lib/sendfile.o lib/recvfile.o lib/time.o \
    335335          lib/ufc.o lib/genrand.o lib/username.o \
    336336          lib/util_pw.o lib/access.o lib/smbrun.o \
  • branches/samba-3.3.x/source/dynconfig.c

    r309 r372  
    6666}
    6767
     68#ifndef __OS2__
    6869DEFINE_DYN_CONFIG_PARAM(SBINDIR)
    6970DEFINE_DYN_CONFIG_PARAM(BINDIR)
    7071DEFINE_DYN_CONFIG_PARAM(SWATDIR)
    71 #ifndef __OS2__
    7272DEFINE_DYN_CONFIG_PARAM(CONFIGFILE) /**< Location of smb.conf file. **/
    7373DEFINE_DYN_CONFIG_PARAM(LOGFILEBASE) /** Log file directory. **/
    7474DEFINE_DYN_CONFIG_PARAM(LMHOSTSFILE) /** Statically configured LanMan hosts. **/
    75 #endif
    7675DEFINE_DYN_CONFIG_PARAM(CODEPAGEDIR)
    7776DEFINE_DYN_CONFIG_PARAM(LIBDIR)
    7877DEFINE_DYN_CONFIG_PARAM(MODULESDIR)
     78#endif
    7979DEFINE_DYN_CONFIG_PARAM(SHLIBEXT)
    8080#ifndef __OS2__
     
    8686
    8787#ifdef __OS2__
    88 static char *dyn_CONFIGFILE; /**< Location of smb.conf file. **/
     88
     89/* Directory the binary was called from, same as getbindir() */
     90static char *dyn_SBINDIR;
     91
     92const char *get_dyn_SBINDIR(void)
     93{
     94        static char buffer[1024] = "";
     95        if (!*buffer)
     96        {
     97                char exedir[1024] = "";
     98                if (os2_GetExePath(exedir) != 0)
     99                {
     100                        snprintf(buffer, 260, "%s", SBINDIR);
     101                } else {
     102                        snprintf(buffer, 260, "%s", exedir);
     103                }
     104        }
     105
     106        if (dyn_SBINDIR == NULL) {
     107                return buffer;
     108        }
     109        return dyn_SBINDIR;
     110}
     111
     112const char *set_dyn_SBINDIR(const char *newpath)
     113{
     114        if (dyn_SBINDIR) {
     115                SAFE_FREE(dyn_SBINDIR);
     116        }
     117        dyn_SBINDIR = SMB_STRDUP(newpath);
     118        return dyn_SBINDIR;
     119}
     120
     121/* Directory the binary was called from, same as getsbindir() */
     122static char *dyn_BINDIR;
     123
     124const char *get_dyn_BINDIR(void)
     125{
     126        static char buffer[1024] = "";
     127        if (!*buffer)
     128        {
     129                char exedir[1024] = "";
     130                if (os2_GetExePath(exedir) != 0)
     131                {
     132                        snprintf(buffer, 260, "%s", BINDIR);
     133                } else {
     134                        snprintf(buffer, 260, "%s", exedir);
     135                }
     136        }
     137
     138        if (dyn_BINDIR == NULL) {
     139                return buffer;
     140        }
     141        return dyn_BINDIR;
     142}
     143
     144const char *set_dyn_BINDIR(const char *newpath)
     145{
     146        if (dyn_BINDIR) {
     147                SAFE_FREE(dyn_BINDIR);
     148        }
     149        dyn_BINDIR = SMB_STRDUP(newpath);
     150        return dyn_BINDIR;
     151}
     152
     153/* Directory holding the SWAT files */
     154static char *dyn_SWATDIR;
     155
     156const char *get_dyn_SWATDIR(void)
     157{
     158        static char buffer[1024] = "";
     159        if (!*buffer)
     160        {
     161                char exedir[1024] = "";
     162                if (os2_GetExePath(exedir) != 0)
     163                {
     164                        snprintf(buffer, 260, "%s", SWATDIR);
     165                } else {
     166                        snprintf(buffer, 260, "%s/%s", exedir,"swat");
     167                }
     168        }
     169
     170        if (dyn_SWATDIR == NULL) {
     171                return buffer;
     172        }
     173        return dyn_SWATDIR;
     174}
     175
     176const char *set_dyn_SWATDIR(const char *newpath)
     177{
     178        if (dyn_SWATDIR) {
     179                SAFE_FREE(dyn_SWATDIR);
     180        }
     181        dyn_SWATDIR = SMB_STRDUP(newpath);
     182        return dyn_SWATDIR;
     183}
     184
     185
     186/* Location of smb.conf file. */
     187static char *dyn_CONFIGFILE;
    89188
    90189const char *get_dyn_CONFIGFILE(void)
     
    183282}
    184283
     284/* Directory holding the codepages */
     285static char *dyn_CODEPAGEDIR;
     286
     287const char *get_dyn_CODEPAGEDIR(void)
     288{
     289        static char buffer[1024] = "";
     290        if (!*buffer)
     291        {
     292                char exedir[1024] = "";
     293                if (os2_GetExePath(exedir) != 0)
     294                {
     295                        snprintf(buffer, 260, "%s", CODEPAGEDIR);
     296                } else {
     297                        snprintf(buffer, 260, "%s/%s", exedir, "codepages");
     298                }
     299        }
     300
     301        if (dyn_CODEPAGEDIR == NULL) {
     302                return buffer;
     303        }
     304        return dyn_CODEPAGEDIR;
     305}
     306
     307const char *set_dyn_CODEPAGEDIR(const char *newpath)
     308{
     309        if (dyn_CODEPAGEDIR) {
     310                SAFE_FREE(dyn_CODEPAGEDIR);
     311        }
     312        dyn_CODEPAGEDIR = SMB_STRDUP(newpath);
     313        return dyn_CODEPAGEDIR;
     314}
     315
     316/* Directory holding the libs */
     317static char *dyn_LIBDIR;
     318
     319const char *get_dyn_LIBDIR(void)
     320{
     321        static char buffer[1024] = "";
     322        if (!*buffer)
     323        {
     324                char exedir[1024] = "";
     325                if (os2_GetExePath(exedir) != 0)
     326                {
     327                        snprintf(buffer, 260, "%s", LIBDIR);
     328                } else {
     329                        snprintf(buffer, 260, "%s/%s", exedir, "lib");
     330                }
     331        }
     332
     333        if (dyn_LIBDIR == NULL) {
     334                return buffer;
     335        }
     336        return dyn_LIBDIR;
     337}
     338
     339const char *set_dyn_LIBDIR(const char *newpath)
     340{
     341        if (dyn_LIBDIR) {
     342                SAFE_FREE(dyn_LIBDIR);
     343        }
     344        dyn_LIBDIR = SMB_STRDUP(newpath);
     345        return dyn_LIBDIR;
     346}
     347
     348/* Directory holding the modules */
     349static char *dyn_MODULESDIR;
     350
     351const char *get_dyn_MODULESDIR(void)
     352{
     353        static char buffer[1024] = "";
     354        if (!*buffer)
     355        {
     356                char exedir[1024] = "";
     357                if (os2_GetExePath(exedir) != 0)
     358                {
     359                        snprintf(buffer, 260, "%s", MODULESDIR);
     360                } else {
     361                        snprintf(buffer, 260, "%s/%s", exedir, "modules");
     362                }
     363        }
     364
     365        if (dyn_MODULESDIR == NULL) {
     366                return buffer;
     367        }
     368        return dyn_MODULESDIR;
     369}
     370
     371const char *set_dyn_MODULESDIR(const char *newpath)
     372{
     373        if (dyn_MODULESDIR) {
     374                SAFE_FREE(dyn_MODULESDIR);
     375        }
     376        dyn_MODULESDIR = SMB_STRDUP(newpath);
     377        return dyn_MODULESDIR;
     378}
     379
    185380/**
    186381 * @brief Directory holding lock files.
     
    213408}
    214409
     410/* Directory holding the pid files */
    215411static char *dyn_PIDDIR;
    216412
     
    237433}
    238434
     435/* Location of smbpasswd */
    239436static char *dyn_SMB_PASSWD_FILE;
    240437
     
    261458}
    262459
     460/* Directory holding the private files */
    263461static char *dyn_PRIVATE_DIR;
    264462
  • branches/samba-3.3.x/source/lib/os2ea.c

    r370 r372  
    2929
    3030#ifndef TESTING
     31
     32// Samba DEBUG() needs the following includes and defines
    3133#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
    3234#define CMD_KI_RDCNT            (0x63)
    33 
     35#include <stdbool.h>
    3436#include "local.h"
    3537#include "xfile.h"
    36 #define DEBUG(a,b) (0)
    37 
     38#include "debug.h"
    3839#else
    3940
     
    167168} CPUUTIL;
    168169
     170APIRET APIENTRY(*pfnDosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL;
     171APIRET APIENTRY(*pfnDosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL;
    169172
    170173static UCHAR randbyte_perf()
     
    174177    int c;
    175178
    176 #ifndef __INNOTEK_LIBC__
    177179    if (hDoscalls == 0) {
    178180        char failed_module[20];
     
    183185
    184186        if (rc == 0) {
    185             rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&DosPerfSysCall);
     187            rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&pfnDosPerfSysCall);
    186188
    187189            if (rc) {
    188                 DosPerfSysCall = NULL;
     190                pfnDosPerfSysCall = NULL;
    189191            }
    190192        }
    191193    }
    192194
    193     if (DosPerfSysCall) {
    194         if (DosPerfSysCall(CMD_KI_RDCNT, (ULONG)&util, 0, 0) == 0) {
     195    if (pfnDosPerfSysCall) {
     196        if ((*pfnDosPerfSysCall) (CMD_KI_RDCNT, (ULONG)&util, 0, 0) == 0) {
    195197            for (c = 0; c < sizeof(util); c++) {
    196198                byte ^= ((UCHAR *)&util)[c];
     
    198200        }
    199201        else {
    200             DosPerfSysCall = NULL;
     202            pfnDosPerfSysCall = NULL;
    201203        }
    202204    }
    203 #endif
     205
    204206    return byte;
    205207}
Note: See TracChangeset for help on using the changeset viewer.