فهرست منبع

check_ide_smart: "__linux__" instead of "linux"

C compilers in standards compliance mode will not define "linux", as it
doesn't begin with an underscore.
Holger Weiss 12 سال پیش
والد
کامیت
8135f66739
1فایلهای تغییر یافته به همراه8 افزوده شده و 8 حذف شده
  1. 8 8
      plugins/check_ide_smart.c

+ 8 - 8
plugins/check_ide_smart.c

@@ -46,12 +46,12 @@ void print_usage (void);
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <fcntl.h>
-#ifdef linux
+#ifdef __linux__
 #include <linux/hdreg.h>
 #include <linux/hdreg.h>
 #include <linux/types.h>
 #include <linux/types.h>
 
 
 #define OPEN_MODE O_RDONLY
 #define OPEN_MODE O_RDONLY
-#endif /* linux */
+#endif /* __linux__ */
 #ifdef __NetBSD__
 #ifdef __NetBSD__
 #include <sys/device.h>
 #include <sys/device.h>
 #include <sys/param.h>
 #include <sys/param.h>
@@ -305,7 +305,7 @@ get_offline_text (int status)
 int
 int
 smart_read_values (int fd, values_t * values) 
 smart_read_values (int fd, values_t * values) 
 {
 {
-#ifdef linux
+#ifdef __linux__
 	int e;
 	int e;
 	__u8 args[4 + 512];
 	__u8 args[4 + 512];
 	args[0] = WIN_SMART;
 	args[0] = WIN_SMART;
@@ -318,7 +318,7 @@ smart_read_values (int fd, values_t * values)
 		return e;
 		return e;
 	}
 	}
 	memcpy (values, args + 4, 512);
 	memcpy (values, args + 4, 512);
-#endif /* linux */
+#endif /* __linux__ */
 #ifdef __NetBSD__
 #ifdef __NetBSD__
 	struct atareq req;
 	struct atareq req;
 	unsigned char inbuf[DEV_BSIZE];
 	unsigned char inbuf[DEV_BSIZE];
@@ -490,7 +490,7 @@ int
 smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error) 
 smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error) 
 {
 {
 	int e = 0;
 	int e = 0;
-#ifdef linux
+#ifdef __linux__
 	__u8 args[4];
 	__u8 args[4];
 	args[0] = WIN_SMART;
 	args[0] = WIN_SMART;
 	args[1] = val0;
 	args[1] = val0;
@@ -502,7 +502,7 @@ smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error)
 			printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
 			printf (_("CRITICAL - %s: %s\n"), smart_command[command].text, strerror (errno));
 		}
 		}
 	}
 	}
-#endif /* linux */
+#endif /* __linux__ */
 #ifdef __NetBSD__
 #ifdef __NetBSD__
 	struct atareq req;
 	struct atareq req;
 
 
@@ -535,7 +535,7 @@ smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error)
 int
 int
 smart_read_thresholds (int fd, thresholds_t * thresholds) 
 smart_read_thresholds (int fd, thresholds_t * thresholds) 
 {
 {
-#ifdef linux
+#ifdef __linux__
 	int e;
 	int e;
 	__u8 args[4 + 512];
 	__u8 args[4 + 512];
 	args[0] = WIN_SMART;
 	args[0] = WIN_SMART;
@@ -548,7 +548,7 @@ smart_read_thresholds (int fd, thresholds_t * thresholds)
 		return e;
 		return e;
 	}
 	}
 	memcpy (thresholds, args + 4, 512);
 	memcpy (thresholds, args + 4, 512);
-#endif /* linux */
+#endif /* __linux__ */
 #ifdef __NetBSD__
 #ifdef __NetBSD__
 	struct atareq req;
 	struct atareq req;
 	unsigned char inbuf[DEV_BSIZE];
 	unsigned char inbuf[DEV_BSIZE];