Skip to content

Commit f0078d2

Browse files
dcuigregkh
authored andcommitted
tools: hv: fix compiler warnings about major/target_fname
[ Upstream commit 1330fc3 ] This patch fixes the below warnings with new glibc and gcc: hv_vss_daemon.c:100:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. hv_fcopy_daemon.c:42:2: note: 'snprintf' output between 2 and 1040 bytes into a destination of size 260 Signed-off-by: Dexuan Cui <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: K. Y. Srinivasan <[email protected]> Signed-off-by: K. Y. Srinivasan <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f85634b commit f0078d2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/hv/hv_fcopy_daemon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
#include <unistd.h>
2424
#include <errno.h>
2525
#include <linux/hyperv.h>
26+
#include <linux/limits.h>
2627
#include <syslog.h>
2728
#include <sys/stat.h>
2829
#include <fcntl.h>
2930
#include <getopt.h>
3031

3132
static int target_fd;
32-
static char target_fname[W_MAX_PATH];
33+
static char target_fname[PATH_MAX];
3334
static unsigned long long filesize;
3435

3536
static int hv_start_fcopy(struct hv_start_fcopy *smsg)

tools/hv/hv_vss_daemon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <sys/poll.h>
2323
#include <sys/ioctl.h>
2424
#include <sys/stat.h>
25+
#include <sys/sysmacros.h>
2526
#include <fcntl.h>
2627
#include <stdio.h>
2728
#include <mntent.h>

0 commit comments

Comments
 (0)