projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
41746d2
)
replace deprecated readdir_r() with readdir()
author
Art Cancro
<ajc@citadel.org>
Fri, 29 Dec 2017 23:10:19 +0000
(18:10 -0500)
committer
Art Cancro
<ajc@citadel.org>
Fri, 29 Dec 2017 23:10:19 +0000
(18:10 -0500)
citadel/modules/bio/serv_bio.c
patch
|
blob
|
history
citadel/modules/image/serv_image.c
patch
|
blob
|
history
citadel/modules/network/serv_netspool.c
patch
|
blob
|
history
citadel/utils/setup.c
patch
|
blob
|
history
diff --git
a/citadel/modules/bio/serv_bio.c
b/citadel/modules/bio/serv_bio.c
index 2436cbfe7b14184e55cd349dd8a89a81c1131781..1c03c480546a6927e4e703f40219ea0d5a205faf 100644
(file)
--- a/
citadel/modules/bio/serv_bio.c
+++ b/
citadel/modules/bio/serv_bio.c
@@
-2,7
+2,7
@@
* This module implementsserver commands related to the display and
* manipulation of user "bio" files.
*
* This module implementsserver commands related to the display and
* manipulation of user "bio" files.
*
- * Copyright (c) 1987-201
6
by the citadel.org team
+ * Copyright (c) 1987-201
7
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-166,8
+166,7
@@
void import_old_bio_files(void)
free(d);
return;
}
free(d);
return;
}
- while ((readdir_r(filedir, d, &filedir_entry) == 0) &&
- (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(filedir)) , (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;
diff --git
a/citadel/modules/image/serv_image.c
b/citadel/modules/image/serv_image.c
index 367814e9f699177b060f80d475a21af4375d3c8d..a7960b10097ebb0697e8c350baa62d1dbb573856 100644
(file)
--- a/
citadel/modules/image/serv_image.c
+++ b/
citadel/modules/image/serv_image.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 1987-201
6
by the citadel.org team
+ * Copyright (c) 1987-201
7
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-297,8
+297,7
@@
void import_old_userpic_files(void)
free(d);
return;
}
free(d);
return;
}
- while ((readdir_r(filedir, d, &filedir_entry) == 0) &&
- (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(filedir)) , (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;
diff --git
a/citadel/modules/network/serv_netspool.c
b/citadel/modules/network/serv_netspool.c
index 7ca9edcd8422f7936ae7d8ecfb321f9ad652e179..34ad8a6c4e3d998e99a1aeaa9c8fabccf9532d92 100644
(file)
--- a/
citadel/modules/network/serv_netspool.c
+++ b/
citadel/modules/network/serv_netspool.c
@@
-826,8
+826,7
@@
void network_do_spoolin(HashList *working_ignetcfg, HashList *the_netmap, int *n
return;
}
return;
}
- while ((readdir_r(dp, d, &filedir_entry) == 0) &&
- (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(filedir)) , (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;
@@
-928,8
+927,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 ((readdir_r(dp, d, &filedir_entry) == 0) &&
- (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(filedir)) , (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;
@@
-1060,8
+1058,7
@@
void network_consolidate_spoolout(HashList *working_ignetcfg, HashList *the_netm
return;
}
return;
}
- while ((readdir_r(dp, d, &filedir_entry) == 0) &&
- (filedir_entry != NULL))
+ while ( (filedir_entry = readdir(filedir)) , (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;
diff --git
a/citadel/utils/setup.c
b/citadel/utils/setup.c
index c66bd8dde3de7bb6bc41875e42ebdbbd06a3efbc..2508712a2ae0108121ec9c81ee8592109785379d 100644
(file)
--- a/
citadel/utils/setup.c
+++ b/
citadel/utils/setup.c
@@
-415,7
+415,6
@@
void progress(char *text, long int curr, long int cmax)
}
}
-
int uds_connectsock(char *sockpath)
{
int s;
int uds_connectsock(char *sockpath)
{
int s;
@@
-618,18
+617,21
@@
void check_xinetd_entry(void)
" server_args = -h -L %s/citadel\n"
" log_on_failure += USERID\n"
"}\n",
" server_args = -h -L %s/citadel\n"
" log_on_failure += USERID\n"
"}\n",
- ctdl_bin_dir);
+ ctdl_bin_dir
+ );
fclose(fp);
fclose(fp);
- /* Now try to restart the service */
- rv = system("/etc/init.d/xinetd restart >/dev/null 2>&1");
+ /* Now try to restart the service. This will not have the intended effect on Solaris, but who the hell uses Solaris anymore? */
+ rv = system("systemctl restart xinetd >/dev/null 2>&1");
+ if (rv != 0) {
+ rv = system("service xinetd restart >/dev/null 2>&1");
+ }
if (rv != 0) {
display_error(_("failed to restart xinetd.\n"));
}
}
if (rv != 0) {
display_error(_("failed to restart xinetd.\n"));
}
}
-
/*
* Offer to disable other MTA's
*/
/*
* Offer to disable other MTA's
*/
@@
-1275,15
+1277,15
@@
int main(int argc, char *argv[])
* Restart citserver
*/
activity = _("Restarting Citadel server to apply changes");
* Restart citserver
*/
activity = _("Restarting Citadel server to apply changes");
- progress(activity, 0,
4
1);
+ progress(activity, 0,
5
1);
serv_puts("TIME");
serv_gets(buf);
long original_start_time = extract_long(&buf[4], 3);
serv_puts("TIME");
serv_gets(buf);
long original_start_time = extract_long(&buf[4], 3);
- progress(activity, 1,
4
1);
+ progress(activity, 1,
5
1);
serv_puts("DOWN 1");
serv_puts("DOWN 1");
- progress(activity, 2,
4
1);
+ progress(activity, 2,
5
1);
serv_gets(buf);
if (buf[0] != '2') {
display_error("%s\n", buf);
serv_gets(buf);
if (buf[0] != '2') {
display_error("%s\n", buf);
@@
-1294,26
+1296,26
@@
int main(int argc, char *argv[])
serv_sock = (-1);
for (i=3; i<=6; ++i) { /* wait for server to shut down */
serv_sock = (-1);
for (i=3; i<=6; ++i) { /* wait for server to shut down */
- progress(activity, i,
4
1);
+ progress(activity, i,
5
1);
sleep(1);
}
sleep(1);
}
- for (i=7; ((i<=
3
8) && (serv_sock < 0)) ; ++i) { /* wait for server to start up */
- progress(activity, i,
4
1);
+ for (i=7; ((i<=
4
8) && (serv_sock < 0)) ; ++i) { /* wait for server to start up */
+ progress(activity, i,
5
1);
serv_sock = uds_connectsock(file_citadel_admin_socket);
sleep(1);
}
serv_sock = uds_connectsock(file_citadel_admin_socket);
sleep(1);
}
- progress(activity,
39, 4
1);
+ progress(activity,
49, 5
1);
serv_gets(buf);
serv_gets(buf);
- progress(activity,
40, 4
1);
+ progress(activity,
50, 5
1);
serv_puts("TIME");
serv_gets(buf);
long new_start_time = extract_long(&buf[4], 3);
close(serv_sock);
serv_puts("TIME");
serv_gets(buf);
long new_start_time = extract_long(&buf[4], 3);
close(serv_sock);
- progress(activity,
41, 4
1);
+ progress(activity,
51, 5
1);
if ( (original_start_time == new_start_time)
|| (new_start_time <= 0)
if ( (original_start_time == new_start_time)
|| (new_start_time <= 0)