mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-13 03:13:08 +03:00
Merge branch '1774_build_cleanups'
* 1774_build_cleanups: Fixed several missing includes Changed include 'glib.h' to 'global.h' because global.h file has some things for vfs/mcserv.c: fixed variable name clashes and missing includes vfs/undelfs.c: Fixed variable name clashes vfs/vfs-impl.h: fixed missing includes vfs/utilvfs.h: fixed missing includes src/screen.c: const char* cleanup, fixing break on -Werror Dropping non-strftime() support and fixing -Werror problem m4.include/mc-use-termcap.m4: fixed const char* issue which triggers break on -Wall Ticket #1774: Various build fixups (missing includes, name clashes, ...)
This commit is contained in:
commit
de4e40dd8f
@ -166,7 +166,7 @@ AC_CHECK_FUNCS([\
|
|||||||
initgroups isascii \
|
initgroups isascii \
|
||||||
memcpy memset \
|
memcpy memset \
|
||||||
putenv \
|
putenv \
|
||||||
setreuid setuid statfs strerror strftime sysconf \
|
setreuid setuid statfs strerror sysconf \
|
||||||
tcgetattr tcsetattr truncate \
|
tcgetattr tcsetattr truncate \
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ if test x"$ac_cv_func_getmntent" = xyes; then
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
],
|
],
|
||||||
[ struct mntent *mnt = 0; char *table = MOUNTED;
|
[ struct mntent *mnt = 0; const char *table = MOUNTED;
|
||||||
if (sizeof mnt && sizeof table) return 0;],
|
if (sizeof mnt && sizeof table) return 0;],
|
||||||
fu_cv_sys_mounted_getmntent1=yes,
|
fu_cv_sys_mounted_getmntent1=yes,
|
||||||
fu_cv_sys_mounted_getmntent1=no)])
|
fu_cv_sys_mounted_getmntent1=no)])
|
||||||
|
@ -24,7 +24,7 @@ AC_DEFUN([MC_SLANG_TERMCAP], [
|
|||||||
#include <slang.h>
|
#include <slang.h>
|
||||||
#endif
|
#endif
|
||||||
],
|
],
|
||||||
[SLtt_get_terminfo(); SLtt_tgetflag("");],
|
[SLtt_get_terminfo(); SLtt_tgetflag((char*)"");],
|
||||||
[mc_cv_slang_termcap=no],
|
[mc_cv_slang_termcap=no],
|
||||||
[mc_cv_slang_termcap=yes])
|
[mc_cv_slang_termcap=yes])
|
||||||
LIBS="$ac_save_LIBS"
|
LIBS="$ac_save_LIBS"
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "../src/tty/tty.h"
|
#include "../src/tty/tty.h"
|
||||||
#include "../src/args.h"
|
#include "../src/args.h"
|
||||||
#include "../src/strutil.h"
|
#include "../src/strutil.h"
|
||||||
|
#include "../src/textconf.h"
|
||||||
|
|
||||||
/*** external variables **************************************************************************/
|
/*** external variables **************************************************************************/
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "../src/fileloc.h"
|
#include "../src/fileloc.h"
|
||||||
#include "../src/strescape.h"
|
#include "../src/strescape.h"
|
||||||
#include "../src/skin/skin.h"
|
#include "../src/skin/skin.h"
|
||||||
|
#include "../../src/util.h"
|
||||||
#include "fhl.h"
|
#include "fhl.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#include "../../vfs/vfs.h" /* mc_stat */
|
#include "../../vfs/vfs.h" /* mc_stat */
|
||||||
|
#include "../../src/util.h"
|
||||||
|
|
||||||
#include "mcconfig.h"
|
#include "mcconfig.h"
|
||||||
|
|
||||||
|
@ -1372,8 +1372,8 @@ panel_paint_sort_info(WPanel *panel)
|
|||||||
static gchar*
|
static gchar*
|
||||||
panel_get_title_without_hotkey(const char *title)
|
panel_get_title_without_hotkey(const char *title)
|
||||||
{
|
{
|
||||||
gchar *translated_title;
|
char *translated_title;
|
||||||
const gchar *hkey;
|
char *hkey;
|
||||||
|
|
||||||
if (title == NULL)
|
if (title == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "../src/global.h"
|
#include "../src/global.h"
|
||||||
#include "../src/main.h"
|
#include "../src/main.h"
|
||||||
#include "../src/fileloc.h"
|
#include "../src/fileloc.h"
|
||||||
|
#include "../../src/util.h"
|
||||||
#include "skin.h"
|
#include "skin.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
#include "../src/textconf.h"
|
||||||
|
|
||||||
#ifdef USE_VFS
|
#ifdef USE_VFS
|
||||||
static const char *const vfs_supported[] = {
|
static const char *const vfs_supported[] = {
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
#define INVALID_TIME_TEXT "(invalid)"
|
#define INVALID_TIME_TEXT "(invalid)"
|
||||||
|
|
||||||
#ifdef HAVE_STRFTIME
|
|
||||||
|
|
||||||
/* safe localtime formatting - strftime()-using version */
|
/* safe localtime formatting - strftime()-using version */
|
||||||
#define FMT_LOCALTIME(buffer, bufsize, fmt, when) \
|
#define FMT_LOCALTIME(buffer, bufsize, fmt, when) \
|
||||||
{ \
|
{ \
|
||||||
@ -28,16 +26,6 @@
|
|||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
/* fallback when strftime/localtime not available */
|
|
||||||
#define FMT_LOCALTIME(buffer,bufsize,fmt,when) \
|
|
||||||
{ \
|
|
||||||
ctime_r(when,buffer); \
|
|
||||||
} \
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FMT_LOCALTIME_CURRENT(buffer, bufsize, fmt) \
|
#define FMT_LOCALTIME_CURRENT(buffer, bufsize, fmt) \
|
||||||
{ \
|
{ \
|
||||||
time_t __current_time; \
|
time_t __current_time; \
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include "../../src/tty/tty.h" /* tty_gotoyx, tty_print_char */
|
#include "../../src/tty/tty.h" /* tty_gotoyx, tty_print_char */
|
||||||
#include "../../src/tty/win.h"
|
#include "../../src/tty/win.h"
|
||||||
|
#include "../../src/util.h"
|
||||||
#include "../../src/cons.saver.h" /* console_flag */
|
#include "../../src/cons.saver.h" /* console_flag */
|
||||||
|
|
||||||
/*** global variables **************************************************/
|
/*** global variables **************************************************/
|
||||||
|
40
vfs/mcserv.c
40
vfs/mcserv.c
@ -42,6 +42,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#ifdef HAVE_LIMITS_H
|
#ifdef HAVE_LIMITS_H
|
||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
@ -297,13 +298,13 @@ do_close (void)
|
|||||||
/* {{{ Stat family routines */
|
/* {{{ Stat family routines */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_time (int sock, time_t time)
|
send_time (int sock, time_t t)
|
||||||
{
|
{
|
||||||
if (clnt_version == 1) {
|
if (clnt_version == 1) {
|
||||||
char *ct;
|
char *ct;
|
||||||
int month;
|
int month;
|
||||||
|
|
||||||
ct = ctime (&time);
|
ct = ctime (&t);
|
||||||
ct[3] = ct[10] = ct[13] = ct[16] = ct[19] = 0;
|
ct[3] = ct[10] = ct[13] = ct[16] = ct[19] = 0;
|
||||||
|
|
||||||
/* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */
|
/* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec */
|
||||||
@ -326,7 +327,7 @@ send_time (int sock, time_t time)
|
|||||||
month = 10;
|
month = 10;
|
||||||
} else
|
} else
|
||||||
month = 11;
|
month = 11;
|
||||||
rpc_send (msock, RPC_INT, atoi (&ct[17]), /* sec */
|
rpc_send (sock, RPC_INT, atoi (&ct[17]), /* sec */
|
||||||
RPC_INT, atoi (&ct[14]), /* min */
|
RPC_INT, atoi (&ct[14]), /* min */
|
||||||
RPC_INT, atoi (&ct[11]), /* hour */
|
RPC_INT, atoi (&ct[11]), /* hour */
|
||||||
RPC_INT, atoi (&ct[8]), /* mday */
|
RPC_INT, atoi (&ct[8]), /* mday */
|
||||||
@ -334,11 +335,11 @@ send_time (int sock, time_t time)
|
|||||||
RPC_INT, month, /* month */
|
RPC_INT, month, /* month */
|
||||||
RPC_END);
|
RPC_END);
|
||||||
} else {
|
} else {
|
||||||
long ltime = (long) time;
|
long ltime = (long) t;
|
||||||
char buf[BUF_SMALL];
|
char buf[BUF_SMALL];
|
||||||
|
|
||||||
snprintf (buf, sizeof (buf), "%lx", ltime);
|
snprintf (buf, sizeof (buf), "%lx", ltime);
|
||||||
rpc_send (msock, RPC_STRING, buf, RPC_END);
|
rpc_send (sock, RPC_STRING, buf, RPC_END);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,16 +595,16 @@ do_mknod (void)
|
|||||||
static void
|
static void
|
||||||
do_readlink (void)
|
do_readlink (void)
|
||||||
{
|
{
|
||||||
char buffer[2048];
|
char buf[2048];
|
||||||
char *file;
|
char *file;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
rpc_get (msock, RPC_STRING, &file, RPC_END);
|
rpc_get (msock, RPC_STRING, &file, RPC_END);
|
||||||
n = readlink (file, buffer, 2048 - 1);
|
n = readlink (file, buf, 2048 - 1);
|
||||||
send_status (n, errno);
|
send_status (n, errno);
|
||||||
if (n >= 0) {
|
if (n >= 0) {
|
||||||
buffer[n] = 0;
|
buf[n] = 0;
|
||||||
rpc_send (msock, RPC_STRING, buffer, RPC_END);
|
rpc_send (msock, RPC_STRING, buf, RPC_END);
|
||||||
}
|
}
|
||||||
g_free (file);
|
g_free (file);
|
||||||
}
|
}
|
||||||
@ -818,12 +819,12 @@ mc_pam_auth (const char *username, const char *password)
|
|||||||
|
|
||||||
/* Keep reading until we find a \n */
|
/* Keep reading until we find a \n */
|
||||||
static int
|
static int
|
||||||
next_line (int socket)
|
next_line (int sock)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (read (socket, &c, 1) <= 0)
|
if (read (sock, &c, 1) <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (c == '\n')
|
if (c == '\n')
|
||||||
return 1;
|
return 1;
|
||||||
@ -1048,15 +1049,16 @@ do_rauth (int socket)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
do_rauth (int msock)
|
do_rauth (int sock)
|
||||||
{
|
{
|
||||||
|
sock = 0; /* prevent warning */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
login_reply (int logged_in)
|
login_reply (int _logged_in)
|
||||||
{
|
{
|
||||||
rpc_send (msock, RPC_INT, logged_in ? MC_LOGINOK : MC_INVALID_PASS,
|
rpc_send (msock, RPC_INT, _logged_in ? MC_LOGINOK : MC_INVALID_PASS,
|
||||||
RPC_END);
|
RPC_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1168,7 +1170,7 @@ void
|
|||||||
tcp_invalidate_socket (int sock)
|
tcp_invalidate_socket (int sock)
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf ("Connection closed\n");
|
printf ("Connection closed [socket %d]\n", sock);
|
||||||
DO_QUIT_VOID ();
|
DO_QUIT_VOID ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1193,7 +1195,7 @@ server (int sock)
|
|||||||
/* {{{ Net support code */
|
/* {{{ Net support code */
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_client (int portnum)
|
get_client (int port)
|
||||||
{
|
{
|
||||||
int sock, newsocket;
|
int sock, newsocket;
|
||||||
unsigned int clilen;
|
unsigned int clilen;
|
||||||
@ -1211,7 +1213,7 @@ get_client (int portnum)
|
|||||||
memset ((char *) &server_address, 0, sizeof (server_address));
|
memset ((char *) &server_address, 0, sizeof (server_address));
|
||||||
server_address.sin_family = AF_INET;
|
server_address.sin_family = AF_INET;
|
||||||
server_address.sin_addr.s_addr = htonl (INADDR_ANY);
|
server_address.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||||
server_address.sin_port = htons (portnum);
|
server_address.sin_port = htons (port);
|
||||||
|
|
||||||
if (bind
|
if (bind
|
||||||
(sock, (struct sockaddr *) &server_address,
|
(sock, (struct sockaddr *) &server_address,
|
||||||
@ -1285,13 +1287,13 @@ get_port_number (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
register_port (int portnum, int abort_if_fail)
|
register_port (int port, int abort_if_fail)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PMAP_SET
|
#ifdef HAVE_PMAP_SET
|
||||||
/* Register our service with the portmapper */
|
/* Register our service with the portmapper */
|
||||||
/* protocol: pmap_set (prognum, versnum, protocol, portp) */
|
/* protocol: pmap_set (prognum, versnum, protocol, portp) */
|
||||||
|
|
||||||
if (pmap_set (RPC_PROGNUM, RPC_PROGVER, IPPROTO_TCP, portnum))
|
if (pmap_set (RPC_PROGNUM, RPC_PROGVER, IPPROTO_TCP, port))
|
||||||
signal (SIGINT, signal_int_handler);
|
signal (SIGINT, signal_int_handler);
|
||||||
else {
|
else {
|
||||||
fprintf (stderr, "Cannot register service with portmapper\n");
|
fprintf (stderr, "Cannot register service with portmapper\n");
|
||||||
|
@ -142,7 +142,7 @@ fi
|
|||||||
AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod)
|
AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod)
|
||||||
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
|
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
|
||||||
AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob pipe crypt16 getauthuid)
|
AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob pipe crypt16 getauthuid)
|
||||||
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
|
AC_CHECK_FUNCS(sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
|
||||||
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf)
|
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf)
|
||||||
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate)
|
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate)
|
||||||
AC_CHECK_FUNCS(grantpt dup2 yp_get_default_domain getpwanam)
|
AC_CHECK_FUNCS(grantpt dup2 yp_get_default_domain getpwanam)
|
||||||
|
@ -493,11 +493,7 @@ char *http_timestring(time_t t)
|
|||||||
if (!tm)
|
if (!tm)
|
||||||
slprintf(buf,sizeof(buf)-1,"%ld seconds since the Epoch",(long)t);
|
slprintf(buf,sizeof(buf)-1,"%ld seconds since the Epoch",(long)t);
|
||||||
else
|
else
|
||||||
#ifndef HAVE_STRFTIME
|
|
||||||
fstrcpy(buf, asctime(tm));
|
|
||||||
#else /* !HAVE_STRFTIME */
|
|
||||||
strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S %Z", tm);
|
strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S %Z", tm);
|
||||||
#endif /* !HAVE_STRFTIME */
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif /*0 */
|
#endif /*0 */
|
||||||
@ -515,11 +511,7 @@ char *timestring(void )
|
|||||||
if (!tm) {
|
if (!tm) {
|
||||||
slprintf(TimeBuf,sizeof(TimeBuf)-1,"%ld seconds since the Epoch",(long)t);
|
slprintf(TimeBuf,sizeof(TimeBuf)-1,"%ld seconds since the Epoch",(long)t);
|
||||||
} else {
|
} else {
|
||||||
#ifdef HAVE_STRFTIME
|
|
||||||
strftime(TimeBuf,100,"%Y/%m/%d %H:%M:%S",tm);
|
strftime(TimeBuf,100,"%Y/%m/%d %H:%M:%S",tm);
|
||||||
#else
|
|
||||||
fstrcpy(TimeBuf, asctime(tm));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return(TimeBuf);
|
return(TimeBuf);
|
||||||
}
|
}
|
||||||
|
@ -158,20 +158,20 @@ undelfs_get_path (const char *dirname, char **fsname, char **file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
undelfs_lsdel_proc(ext2_filsys fs, blk_t *block_nr, int blockcnt, void *private)
|
undelfs_lsdel_proc(ext2_filsys _fs, blk_t *block_nr, int blockcnt, void *private)
|
||||||
{
|
{
|
||||||
struct lsdel_struct *lsd = (struct lsdel_struct *) private;
|
struct lsdel_struct *_lsd = (struct lsdel_struct *) private;
|
||||||
(void) blockcnt;
|
(void) blockcnt;
|
||||||
lsd->num_blocks++;
|
_lsd->num_blocks++;
|
||||||
|
|
||||||
if (*block_nr < fs->super->s_first_data_block ||
|
if (*block_nr < _fs->super->s_first_data_block ||
|
||||||
*block_nr >= fs->super->s_blocks_count) {
|
*block_nr >= _fs->super->s_blocks_count) {
|
||||||
lsd->bad_blocks++;
|
_lsd->bad_blocks++;
|
||||||
return BLOCK_ABORT;
|
return BLOCK_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ext2fs_test_block_bitmap(fs->block_map,*block_nr))
|
if (!ext2fs_test_block_bitmap(_fs->block_map,*block_nr))
|
||||||
lsd->free_blocks++;
|
_lsd->free_blocks++;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include "../src/global.h"
|
||||||
|
|
||||||
/* Flags for vfs_split_url() */
|
/* Flags for vfs_split_url() */
|
||||||
#define URL_ALLOW_ANON 1
|
#define URL_ALLOW_ANON 1
|
||||||
#define URL_NOSLASH 2
|
#define URL_NOSLASH 2
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <utime.h>
|
||||||
|
|
||||||
#include "../src/fs.h" /* MC_MAXPATHLEN */
|
#include "../src/fs.h" /* MC_MAXPATHLEN */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user