Author: jra
Date: 2005-08-23 21:29:40 +0000 (Tue, 23 Aug 2005)
New Revision: 9546

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9546

Log:
(Hopefully the last) fixes for DIR -> SMB_STRUCT_DIR.
Jeremy.

Modified:
   trunk/source/client/client.c
   trunk/source/client/smbspool.c
   trunk/source/lib/system.c
   trunk/source/smbd/chgpasswd.c
   trunk/source/smbd/msdfs.c


Changeset:
Modified: trunk/source/client/client.c
===================================================================
--- trunk/source/client/client.c        2005-08-23 21:29:37 UTC (rev 9545)
+++ trunk/source/client/client.c        2005-08-23 21:29:40 UTC (rev 9546)
@@ -1379,7 +1379,7 @@
 static int file_find(struct file_list **list, const char *directory, 
                      const char *expression, BOOL match)
 {
-       DIR *dir;
+       SMB_STRUCT_DIR *dir;
        struct file_list *entry;
         struct stat statbuf;
         int ret;
@@ -1387,7 +1387,7 @@
        BOOL isdir;
        const char *dname;
 
-        dir = opendir(directory);
+        dir = sys_opendir(directory);
        if (!dir)
                return -1;
        
@@ -1416,14 +1416,14 @@
                                
                                if (ret == -1) {
                                        SAFE_FREE(path);
-                                       closedir(dir);
+                                       sys_closedir(dir);
                                        return -1;
                                }
                        }
                        entry = SMB_MALLOC_P(struct file_list);
                        if (!entry) {
                                d_printf("Out of memory in file_find\n");
-                               closedir(dir);
+                               sys_closedir(dir);
                                return -1;
                        }
                        entry->file_path = path;
@@ -1434,7 +1434,7 @@
                }
         }
 
-       closedir(dir);
+       sys_closedir(dir);
        return 0;
 }
 

Modified: trunk/source/client/smbspool.c
===================================================================
--- trunk/source/client/smbspool.c      2005-08-23 21:29:37 UTC (rev 9545)
+++ trunk/source/client/smbspool.c      2005-08-23 21:29:40 UTC (rev 9546)
@@ -288,7 +288,7 @@
 static
 char * get_ticket_cache( uid_t uid )
 {
-  DIR *tcdir;                  /* directory where ticket caches are stored */
+  SMB_STRUCT_DIR *tcdir;                  /* directory where ticket caches are 
stored */
   SMB_STRUCT_DIRENT *dirent;   /* directory entry */
   char *filename = NULL;       /* holds file names on the tmp directory */
   SMB_STRUCT_STAT buf;        
@@ -298,7 +298,7 @@
   time_t t = 0;
   
   snprintf(user_cache_prefix, CC_MAX_FILE_LEN, "%s%d", CC_PREFIX, uid );
-  tcdir = opendir( TICKET_CC_DIR );
+  tcdir = sys_opendir( TICKET_CC_DIR );
   if ( tcdir == NULL ) 
     return NULL; 
   
@@ -331,6 +331,8 @@
     }
   }
 
+  sys_closedir(tcdir);
+
   if ( ticket_file == NULL )
   {
     /* no ticket cache found */

Modified: trunk/source/lib/system.c
===================================================================
--- trunk/source/lib/system.c   2005-08-23 21:29:37 UTC (rev 9545)
+++ trunk/source/lib/system.c   2005-08-23 21:29:40 UTC (rev 9546)
@@ -960,7 +960,7 @@
  Wide opendir. Just narrow and call sys_xxx.
 ****************************************************************************/
 
-DIR *wsys_opendir(const smb_ucs2_t *wfname)
+SMB_STRUCT_DIR *wsys_opendir(const smb_ucs2_t *wfname)
 {
        pstring fname;
        return opendir(unicode_to_unix(fname,wfname,sizeof(fname)));
@@ -970,7 +970,7 @@
  Wide readdir. Return a structure pointer containing a wide filename.
 ****************************************************************************/
 
-SMB_STRUCT_WDIRENT *wsys_readdir(DIR *dirp)
+SMB_STRUCT_WDIRENT *wsys_readdir(SMB_STRUCT_DIR *dirp)
 {
        static SMB_STRUCT_WDIRENT retval;
        SMB_STRUCT_DIRENT *dirval = sys_readdir(dirp);

Modified: trunk/source/smbd/chgpasswd.c
===================================================================
--- trunk/source/smbd/chgpasswd.c       2005-08-23 21:29:37 UTC (rev 9545)
+++ trunk/source/smbd/chgpasswd.c       2005-08-23 21:29:40 UTC (rev 9546)
@@ -64,7 +64,7 @@
 {
        int master;
        static fstring line;
-       DIR *dirp;
+       SMB_STRUCT_DIR *dirp;
        const char *dpname;
 
 #if defined(HAVE_GRANTPT)
@@ -93,7 +93,7 @@
 
        fstrcpy(line, "/dev/ptyXX");
 
-       dirp = opendir("/dev");
+       dirp = sys_opendir("/dev");
        if (!dirp)
                return (-1);
        while ((dpname = readdirname(dirp)) != NULL)
@@ -110,12 +110,12 @@
                                DEBUG(3, ("pty: opened %s\n", line));
                                line[5] = 't';
                                *slave = line;
-                               closedir(dirp);
+                               sys_closedir(dirp);
                                return (master);
                        }
                }
        }
-       closedir(dirp);
+       sys_closedir(dirp);
        return (-1);
 }
 

Modified: trunk/source/smbd/msdfs.c
===================================================================
--- trunk/source/smbd/msdfs.c   2005-08-23 21:29:37 UTC (rev 9545)
+++ trunk/source/smbd/msdfs.c   2005-08-23 21:29:40 UTC (rev 9546)
@@ -1010,7 +1010,7 @@
 static int form_junctions(TALLOC_CTX *ctx, int snum, struct junction_map 
*jucn, int jn_remain)
 {
        int cnt = 0;
-       DIR *dirp;
+       SMB_STRUCT_DIR *dirp;
        char* dname;
        pstring connect_path;
        char* service_name = lp_servicename(snum);

Reply via email to