Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50e4961

Browse files
author
Felipe Zimmerle
committed
Uses autotools to idenfiy if sys/utsname.h is present
Fix build problem on the msc_status_engine, reported by: Walter Hop andDerek Werthmuller.
1 parent3323137 commit50e4961

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

‎apache2/msc_status_engine.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include"msc_status_engine.h"
1616
#include"apr_sha1.h"
17+
#include"modsecurity_config.h"
1718

1819
#ifdefWIN32
1920
#include<winsock2.h>
@@ -26,20 +27,20 @@
2627
#include<net/if.h>
2728
#include<net/if_dl.h>
2829
#include<netinet/in.h>
29-
#include<sys/utsname.h>
3030
#include<sys/types.h>
3131
#include<sys/socket.h>
3232
#ifndefIFT_ETHER
3333
#defineIFT_ETHER 0x6/* Ethernet CSMACD */
3434
#endif
3535
#endif
3636

37-
#ifdef__gnu_linux__
38-
#include<sys/utsname.h>
37+
#if (defined(__linux__)|| defined(__gnu_linux__))
3938
#include<linux/if.h>
4039
#include<linux/sockios.h>
4140
#endif
42-
41+
#ifdefHAVE_SYS_UTSNAME_H
42+
#include<sys/utsname.h>
43+
#endif
4344

4445
// Bese32 encode, based on:
4546
// https://code.google.com/p/google-authenticator/source/browse/libpam/base32.c
@@ -133,7 +134,9 @@ int DSOLOCAL msc_status_engine_machine_name(char *machine_name, size_t len) {
133134
if (GetComputerName(machine_name,&lenComputerName)==0) {
134135
gotofailed;
135136
}
136-
#else
137+
#endif
138+
139+
#ifdefHAVE_SYS_UTSNAME_H
137140
staticstructutsnameu;
138141

139142
if (uname(&u )<0 ) {
@@ -180,7 +183,7 @@ int DSOLOCAL msc_status_engine_mac_address (unsigned char *mac)
180183
freeifaddrs(ifaphead );
181184
#endif
182185

183-
#if__gnu_linux__
186+
#if(defined(__linux__)|| defined(__gnu_linux__))
184187
structifconfconf;
185188
intsock=socket(AF_INET,SOCK_DGRAM,IPPROTO_IP );
186189
structifreq*ifr;

‎configure.ac‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ AC_PATH_PROGS(ENV_CMD, [env printenv], )
3333

3434
# Checks for header files.
3535
AC_HEADER_STDC
36-
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/types.h sys/stat.h])
36+
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/types.h sys/stat.h sys/utsname.h])
3737

3838
# Checks for typedefs, structures, and compiler characteristics.
3939
AC_C_CONST

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp