projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More work on replace deprecated readdir_r()
[citadel.git]
/
citadel
/
modules
/
network
/
serv_netspool.c
diff --git
a/citadel/modules/network/serv_netspool.c
b/citadel/modules/network/serv_netspool.c
index 34ad8a6c4e3d998e99a1aeaa9c8fabccf9532d92..a792601b34f29a8539554d5d664902d771f78150 100644
(file)
--- a/
citadel/modules/network/serv_netspool.c
+++ b/
citadel/modules/network/serv_netspool.c
@@
-826,7
+826,7
@@
void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *n
return;
}
return;
}
- while ( (filedir_entry = readdir(
filedir
)) , (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(
dp
)) , (filedir_entry != NULL))
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
@@
-900,7
+900,6
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
FDIOBuffer FDIO;
int d_namelen;
DIR *dp;
FDIOBuffer FDIO;
int d_namelen;
DIR *dp;
- struct dirent *d;
struct dirent *filedir_entry;
const char *pch;
char spooloutfilename[PATH_MAX];
struct dirent *filedir_entry;
const char *pch;
char spooloutfilename[PATH_MAX];
@@
-913,12
+912,9
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
int d_type = 0;
/* Step 1: consolidate files in the outbound queue into one file per neighbor node */
int d_type = 0;
/* Step 1: consolidate files in the outbound queue into one file per neighbor node */
- d = (struct dirent *)malloc(offsetof(struct dirent, d_name) + PATH_MAX + 1);
- if (d == NULL) return;
dp = opendir(ctdl_netout_dir);
if (dp == NULL) {
dp = opendir(ctdl_netout_dir);
if (dp == NULL) {
- free(d);
return;
}
return;
}
@@
-927,7
+923,7
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
memset(&FDIO, 0, sizeof(FDIOBuffer));
FDIO.IOB = &IOB;
memset(&FDIO, 0, sizeof(FDIOBuffer));
FDIO.IOB = &IOB;
- while ( (filedir_entry = readdir(
filedir
)) , (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(
dp
)) , (filedir_entry != NULL))
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
@@
-1046,7
+1042,6
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
if (nFailed > 0) {
FreeStrBuf(&NextHop);
syslog(LOG_INFO, "netspool: skipping Spoolcleanup because of %d files unprocessed.", nFailed);
if (nFailed > 0) {
FreeStrBuf(&NextHop);
syslog(LOG_INFO, "netspool: skipping Spoolcleanup because of %d files unprocessed.", nFailed);
-
return;
}
return;
}
@@
-1054,11
+1049,10
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
dp = opendir(ctdl_netout_dir);
if (dp == NULL) {
FreeStrBuf(&NextHop);
dp = opendir(ctdl_netout_dir);
if (dp == NULL) {
FreeStrBuf(&NextHop);
- free(d);
return;
}
return;
}
- while ( (filedir_entry = readdir(
filedir
)) , (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(
dp
)) , (filedir_entry != NULL))
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
{
#ifdef _DIRENT_HAVE_D_NAMLEN
d_namelen = filedir_entry->d_namlen;
@@
-1110,7
+1104,6
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
}
}
FreeStrBuf(&NextHop);
}
}
FreeStrBuf(&NextHop);
- free(d);
closedir(dp);
}
closedir(dp);
}