From b7b5c71de37066cf3f0793c5426275cec7710806 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Thu, 15 Mar 2001 18:19:23 +0000 Subject: [PATCH] * samba/libsmb/smbdes.c: undefine uchar before redefine it * smbfs.c (smbfs_close): honour changed semantics for return value (on error -1 is expected). * (fs): it is at least strange use char * for counter. Changed to int --- vfs/ChangeLog | 9 +++++++++ vfs/samba/libsmb/smbdes.c | 4 ++-- vfs/smbfs.c | 20 +++++++++----------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index d9aeb445a..c4c39ec4a 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,12 @@ +2001-03-15 Andrew V. Samoilov + + * samba/libsmb/smbdes.c: undefine uchar before redefine it + + * smbfs.c (smbfs_close): honour changed semantics for return value + (on error -1 is expected). + + * (fs): it is at least strange use char * for counter. Changed to int + 2001-03-14 Pavel Roskin * Make-mc.in: Use Automake conditional USE_SAMBA_FS. diff --git a/vfs/samba/libsmb/smbdes.c b/vfs/samba/libsmb/smbdes.c index d0e1c6e85..152fed961 100644 --- a/vfs/samba/libsmb/smbdes.c +++ b/vfs/samba/libsmb/smbdes.c @@ -46,8 +46,8 @@ up with a different answer to the one above) */ - -#define uchar unsigned char +#undef uchar +#define uchar const unsigned char static uchar perm1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, diff --git a/vfs/smbfs.c b/vfs/smbfs.c index 04649fac5..7263ba722 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -388,10 +388,9 @@ smbfs_init(vfs *me) if(!get_myname(myhostname,NULL)) DEBUG(0,("Failed to get my hostname.\n")); - if (!lp_load(servicesf,True,False,False)) { - if (errno != ENOENT) + if (!lp_load(servicesf,True,False,False)) DEBUG(0, ("Can't load %s - run testparm to debug it\n", servicesf)); - } + codepage_initialise(lp_client_code_page()); load_interfaces(); @@ -467,7 +466,7 @@ smbfs_close (void *data) if (archive_level >= 2 && (inf->attr & aARCH)) { cli_setatr(info->cli, rname, info->attr & ~(uint16)aARCH, 0); } */ - return cli_close(info->cli, info->fnum); + return (cli_close(info->cli, info->fnum) == True) ? 0 : -1; } static int @@ -513,12 +512,11 @@ browsing_helper(const char *name, uint32 type, const char *comment) if (first_direntry) { current_info->entries = new_entry; - current_info->current = new_entry; first_direntry = FALSE; } else { current_info->current->next = new_entry; - current_info->current = new_entry; } + current_info->current = new_entry; bzero(&new_entry->my_stat, sizeof(struct stat)); new_entry->merrno = 0; @@ -753,14 +751,14 @@ chkpath(struct cli_state *cli, char *path, BOOL send_only) /* #if 0 */ static int -fs (char *text) +fs (const char *text) { - char *p, count = 0; - p = strchr(text, '/'); - while (p) { + const char *p = text; + int count = 0; + + while ((p = strchr(p, '/')) != NULL) { count++; p++; - p = strchr(p, '/'); } if (count == 1) return strlen(text);