зеркало из https://github.com/Azure/sonic-openssh.git
- (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit
hacked code.
This commit is contained in:
Родитель
f50ad1fd04
Коммит
0e7f4363f3
|
@ -1,3 +1,7 @@
|
|||
20030428
|
||||
- (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit
|
||||
hacked code.
|
||||
|
||||
20030427
|
||||
- (bal) Bug #541: return; was dropped by mistake. Reported by
|
||||
furrier@iglou.com
|
||||
|
@ -1345,4 +1349,4 @@
|
|||
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
||||
ok provos@
|
||||
|
||||
$Id: ChangeLog,v 1.2662 2003/04/27 18:44:31 mouring Exp $
|
||||
$Id: ChangeLog,v 1.2663 2003/04/28 23:30:43 mouring Exp $
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _DEFINES_H
|
||||
#define _DEFINES_H
|
||||
|
||||
/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */
|
||||
/* $Id: defines.h,v 1.98 2003/04/28 23:30:43 mouring Exp $ */
|
||||
|
||||
|
||||
/* Constants */
|
||||
|
@ -188,28 +188,21 @@ typedef unsigned long u_int32_t;
|
|||
#ifndef HAVE_INT64_T
|
||||
# if (SIZEOF_LONG_INT == 8)
|
||||
typedef long int int64_t;
|
||||
# define HAVE_INT64_T 1
|
||||
# else
|
||||
# if (SIZEOF_LONG_LONG_INT == 8)
|
||||
typedef long long int int64_t;
|
||||
# define HAVE_INT64_T 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#ifndef HAVE_U_INT64_T
|
||||
# if (SIZEOF_LONG_INT == 8)
|
||||
typedef unsigned long int u_int64_t;
|
||||
# define HAVE_U_INT64_T 1
|
||||
# else
|
||||
# if (SIZEOF_LONG_LONG_INT == 8)
|
||||
typedef unsigned long long int u_int64_t;
|
||||
# define HAVE_U_INT64_T 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
|
||||
# define HAVE_LONG_LONG_INT 1
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_U_CHAR
|
||||
typedef unsigned char u_char;
|
||||
|
|
|
@ -215,36 +215,19 @@ draw_progress_meter()
|
|||
|
||||
nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
|
||||
|
||||
#ifdef HAVE_LONG_LONG_INT
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
|
||||
curfile,
|
||||
nspaces,
|
||||
spaces,
|
||||
ratio,
|
||||
(long long)abbrevsize,
|
||||
(int64_t)abbrevsize,
|
||||
prefixes[ai],
|
||||
ai == 0 ? ' ' : 'B',
|
||||
(long long)(bytespersec / 1024),
|
||||
(int64_t)(bytespersec / 1024),
|
||||
(int)((bytespersec % 1024) * 10 / 1024),
|
||||
prefixes[bi]
|
||||
);
|
||||
#else
|
||||
/* XXX: Handle integer overflow? */
|
||||
snprintf(buf, sizeof(buf),
|
||||
"\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s",
|
||||
curfile,
|
||||
nspaces,
|
||||
spaces,
|
||||
ratio,
|
||||
(u_long)abbrevsize,
|
||||
prefixes[ai],
|
||||
ai == 0 ? ' ' : 'B',
|
||||
(u_long)(bytespersec / 1024),
|
||||
(int)((bytespersec % 1024) * 10 / 1024),
|
||||
prefixes[bi]
|
||||
);
|
||||
#endif
|
||||
|
||||
if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
|
||||
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
|
||||
|
|
9
scp.c
9
scp.c
|
@ -554,16 +554,9 @@ syserr: run_err("%s: %s", name, strerror(errno));
|
|||
goto next;
|
||||
}
|
||||
#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
|
||||
#ifdef HAVE_LONG_LONG_INT
|
||||
snprintf(buf, sizeof buf, "C%04o %lld %s\n",
|
||||
(u_int) (stb.st_mode & FILEMODEMASK),
|
||||
(long long)stb.st_size, last);
|
||||
#else
|
||||
/* XXX: Handle integer overflow? */
|
||||
snprintf(buf, sizeof buf, "C%04o %lu %s\n",
|
||||
(u_int) (stb.st_mode & FILEMODEMASK),
|
||||
(u_long) stb.st_size, last);
|
||||
#endif
|
||||
(int64_t)stb.st_size, last);
|
||||
if (verbose_mode) {
|
||||
fprintf(stderr, "Sending file modes: %s", buf);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче