diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-01-03 08:28:12 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-01-03 08:28:12 +0000 |
commit | 634c54310c92c48dd4eceec602e230a021bdcfc5 (patch) | |
tree | 9f5732a180b8daacf176e42511b0a72c972c7a4b /source3/smbd/dir.c | |
parent | 47a7f0cfb5006fb41239a6cd81cce5e35fde750a (diff) | |
download | samba-634c54310c92c48dd4eceec602e230a021bdcfc5.tar.gz samba-634c54310c92c48dd4eceec602e230a021bdcfc5.tar.bz2 samba-634c54310c92c48dd4eceec602e230a021bdcfc5.zip |
Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings. (Adds a lot of const).
Andrew Bartlett
(This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
Diffstat (limited to 'source3/smbd/dir.c')
-rw-r--r-- | source3/smbd/dir.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 396ecd98c4..d3c71ad24e 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -327,15 +327,20 @@ void dptr_closepath(char *path,uint16 spid) Start a directory listing. ****************************************************************************/ -static BOOL start_dir(connection_struct *conn,char *directory) +static BOOL start_dir(connection_struct *conn, pstring directory) { + const char *dir2; + DEBUG(5,("start_dir dir=%s\n",directory)); if (!check_name(directory,conn)) return(False); + + /* use a const pointer from here on */ + dir2 = directory; - if (! *directory) - directory = "."; + if (! *dir2) + dir2 = "."; conn->dirptr = OpenDir(conn, directory, True); if (conn->dirptr) { @@ -392,7 +397,7 @@ static void dptr_close_oldest(BOOL old) me at Andrew's knee.... :-) :-). JRA. ****************************************************************************/ -int dptr_create(connection_struct *conn,char *path, BOOL old_handle, BOOL expect_close,uint16 spid) +int dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOOL expect_close,uint16 spid) { dptr_struct *dptr; @@ -812,10 +817,10 @@ static BOOL file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT Open a directory. ********************************************************************/ -void *OpenDir(connection_struct *conn, char *name, BOOL use_veto) +void *OpenDir(connection_struct *conn, const char *name, BOOL use_veto) { Dir *dirp; - char *n; + const char *n; DIR *p = conn->vfs_ops.opendir(conn,name); int used=0; @@ -1009,7 +1014,7 @@ static ubi_dlNewList( dir_cache ); Output: None. *****************************************************************************/ -void DirCacheAdd( char *path, char *name, char *dname, int snum ) +void DirCacheAdd( const char *path, char *name, char *dname, int snum ) { int pathlen; int namelen; @@ -1056,7 +1061,7 @@ void DirCacheAdd( char *path, char *name, char *dname, int snum ) for large caches. *****************************************************************************/ -char *DirCacheCheck( char *path, char *name, int snum ) +char *DirCacheCheck( const char *path, const char *name, int snum ) { dir_cache_entry *entry; |