Changeset 147

Show
Ignore:
Timestamp:
08/19/08 15:26:53 (4 months ago)
Author:
ydario
Message:

Map errno smb errors to OS/2 error codes. Minor build system rework.

Location:
branches/client-1.5/src
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • branches/client-1.5/src/Config.km_

    r146 r147  
    55VERSION = 1.4.9 
    66BUILD   = Alpha_1 
    7 SAMBA   = ../../samba-3.0/source 
     7SAMBA   = ../../samba-3.0 
    88TOOLKIT = f:/dev/toolkit452 
  • branches/client-1.5/src/Makefile.kmk

    r146 r147  
    22# please define (as env variables or kmk command line) the following variables before starting: 
    33# BUILD_PLATFORM = os2 
    4 # BUILD_MODE = release|debug 
     4# BUILD_TYPE = release|debug 
    55# 
    66# Copy Config.km_ to Config.kmk and edit it to match your installation. 
     
    1313DLLS = ndpsmb 
    1414 
    15 #ndpsmb_INST = $(DEPTH)/bin 
    1615ndpsmb_SOURCES = \ 
    1716        rc/rc.rc \ 
     
    2019        debug.c \ 
    2120        printf.c \ 
     21        util.c \ 
    2222        smbwrp.c 
    2323 
    24 ndpsmb_CFLAGS = -s -Zomf -O3 -march=pentium -mcpu=pentium4 
    25 ndpsmb_LDFLAGS = -s -Zomf -Zno-fork -Zmap -Zbin-files 
    26 ndpsmb_CFLAGS.debug = -g -Zomf -O0 -march=pentium -mcpu=pentium4 -DDEBUG_PRINTF 
    27 ndpsmb_LDFLAGS.debug = -g -Zomf -Zno-fork -Zmap -Zbin-files 
     24ndpsmb_CFLAGS = -Zomf 
     25ndpsmb_CFLAGS.release = -s -O3 -march=pentium -mcpu=pentium4 
     26ndpsmb_CFLAGS.debug = -g -O0 -DDEBUG_PRINTF 
     27ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zbin-files 
     28ndpsmb_LDFLAGS.release = -s 
     29ndpsmb_LDFLAGS.debug = -g 
    2830 
    2931ndpsmb_DEFS =  
    3032ndpsmb_INCS = ./h ./rc \ 
    31                 $(SAMBA) \ 
    32                 $(SAMBA)/include \ 
    33                 $(SAMBA)/lib/replace \ 
    34                 $(SAMBA)/popt \ 
    35                 $(SAMBA)/lib/talloc \ 
    36                 $(SAMBA)/librpc \ 
    37                 $(SAMBA)/tdb/include 
     33                $(SAMBA)/source \ 
     34                $(SAMBA)/source/include \ 
     35                $(SAMBA)/source/lib/replace \ 
     36                $(SAMBA)/source/popt \ 
     37                $(SAMBA)/source/lib/talloc \ 
     38                $(SAMBA)/source/librpc \ 
     39                $(SAMBA)/source/tdb/include 
    3840 
    3941ndpsmb_LIBS = libsmbclient.a socket.a 
    40 ndpsmb_LIBPATH = $(SAMBA)/bin 
     42ndpsmb_LIBPATH = $(SAMBA)/source/bin 
    4143 
    42 ndpsmb_CLEAN = rc/description.rc ndpsmb.hlp 
     44ndpsmb_CLEAN = rc/description.rc $(PATH_BIN)/ndpsmb.hlp 
    4345 
    4446#build other files (e.g. help) 
    45 OTHERS = ndpsmb.hlp 
     47OTHERS = $(PATH_BIN)/ndpsmb.hlp 
    4648 
    47 # without this rule, kmk will fail! 
    48 PROGRAMS = 
    49  
     49# now include standard code 
    5050include $(PATH_KBUILD)/rules.kMk 
    5151 
     
    6060        @BldLevelInf0.cmd $(VERSION) $(BUILD) 
    6161 
    62 ndpsmb.hlp: ./rc/rc.ipf ./rc/rc.h ./H/hmacros.h config.kmk 
     62$(PATH_BIN)/ndpsmb.hlp: ./rc/rc.ipf ./rc/rc.h ./H/hmacros.h config.kmk 
    6363        -gcc -E -I./h -I./rc -x c ./rc/rc.ipf > rc.i 
    64         $(TOOLKIT)\bin\ipfc.exe rc.i ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 
     64        -@mkdir $(PATH_BIN) 
     65        $(TOOLKIT)\bin\ipfc.exe rc.i $(PATH_BIN)/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850 
    6566        rm rc.i 
    6667 
  • branches/client-1.5/src/ndpsmb.c

    r146 r147  
    77#define INCL_LONGLONG 
    88#include <ndextpl2.h> 
    9 #include <smbwrp.h> 
     9#include "smbwrp.h" 
     10#include "util.h" 
    1011 
    1112#ifndef DEBUG_PRINTF 
  • branches/client-1.5/src/smbwrp.c

    r145 r147  
    8989/* 
    9090 * Wrapper for cli_errno to return not connected error on negative fd 
     91 * Now returns an OS/2 return code instead of lerrno. 
    9192 */ 
    9293int os2cli_errno(cli_state * cli) 
     
    9697                return ENOTCONN; 
    9798        } 
    98         return cli_errno(cli); 
     99        return maperror(cli_errno(cli)); 
    99100} 
    100101 
     
    16991700} 
    17001701 
    1701  
    1702 char * getlastslash(char * path) 
    1703 { 
    1704         char * p; 
    1705         if (!path) 
    1706         { 
    1707                 return NULL; 
    1708         } 
    1709         for (p = path + strlen(path) - 1; p >= path; p--) 
    1710         { 
    1711                 if (*p == '\\' || *p == '/') 
    1712                 { 
    1713                         return p; 
    1714                 } 
    1715         } 
    1716         return NULL; 
    1717 } 
    1718