Ignore:
Timestamp:
Jan 13, 2010, 7:52:51 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

_divers os2_getExePath applied to BINDIR, SBINDIR and SWATDIR in 3.0.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/dynconfig.c

    r366 r367  
    4141 **/
    4242
    43 char const *dyn_SBINDIR = SBINDIR,
    44         *dyn_BINDIR = BINDIR,
    45         *dyn_SWATDIR = SWATDIR;
    4643
    4744#ifdef __OS2__
     45
     46/* Directory the binary was called from, same as getbindir() */
     47const char * getsbindir()
     48{
     49        static pstring buffer = "";
     50        if (!*buffer)
     51        {
     52                pstring exedir = "";
     53                if (os2_GetExePath(exedir) != 0)
     54                {
     55                        snprintf(buffer, 260, "%s", SBINDIR);
     56                } else {
     57                        snprintf(buffer, 260, "%s", exedir);
     58                }
     59        }
     60        return buffer;
     61}
     62
     63/* Directory the binary was called from, same as getsbindir() */
     64const char * getbindir()
     65{
     66        static pstring buffer = "";
     67        if (!*buffer)
     68        {
     69                pstring exedir = "";
     70                if (os2_GetExePath(exedir) != 0)
     71                {
     72                        snprintf(buffer, 260, "%s", BINDIR);
     73                } else {
     74                        snprintf(buffer, 260, "%s", exedir);
     75                }
     76        }
     77        return buffer;
     78}
     79
     80/* Directory holding the SWAT files */
     81const char * getswatdir()
     82{
     83        static pstring buffer = "";
     84        if (!*buffer)
     85        {
     86                pstring exedir = "";
     87                if (os2_GetExePath(exedir) != 0)
     88                {
     89                        snprintf(buffer, 260, "%s", SWATDIR);
     90                } else {
     91                        snprintf(buffer, 260, "%s/%s", exedir,"swat");
     92                }
     93        }
     94        return buffer;
     95}
     96
     97/* Location of smb.conf file. */
    4898const char * getconfigfile()
    4999{
     
    74124}
    75125
     126/* Log file directory */
    76127const char * getlogbase()
    77128{
     
    84135}
    85136
     137/* Directory holding lock files */
    86138const char * getlockdir()
    87139{
     
    94146}
    95147
     148/* Directory holding the pid files */
    96149const char * getpiddir()
    97150{
     
    104157}
    105158
     159/* Directory holding the private files */
    106160const char * getprivatedir()
    107161{
     
    114168}
    115169
     170/* Location of smbpasswd */
    116171const char * getsmbpasswd()
    117172{
     
    124179}
    125180
     181/* Statically configured LanMan hosts */
    126182const char * getlmhosts()
    127183{
     
    139195 * @sa lib_path() to get the path to a file inside the LIBDIR.
    140196 **/
    141 // we try to set the libdir based on the current running process
     197// SCS we try to set the libdir based on the current running process
    142198const char * getlibdir()
    143199{
     
    158214fstring dyn_SHLIBEXT = SHLIBEXT;
    159215
    160 
    161216#else
    162217
    163 pstring dyn_CONFIGFILE = CONFIGFILE; /**< Location of smb.conf file. **/
     218char const *dyn_SBINDIR = SBINDIR,
     219        *dyn_BINDIR = BINDIR,
     220        *dyn_SWATDIR = SWATDIR;
     221
     222/**< Location of smb.conf file. **/
     223pstring dyn_CONFIGFILE = CONFIGFILE;
    164224
    165225/** Log file directory. **/
Note: See TracChangeset for help on using the changeset viewer.