summaryrefslogtreecommitdiffstats
path: root/gl/stat.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2026-03-27 11:14:20 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2026-03-27 11:14:20 +0100
commit1113bbcd92d85b85579aa7feef511241e58fb0f5 (patch)
treed69b7bcfe2f7e80fda9a1f4ddd38209d6cb7aaf0 /gl/stat.c
parent99283972fe3a74d3a1dea12c4099f76286130a67 (diff)
parenta71ce153082565e5728424749475593dc0623492 (diff)
downloadmonitoring-plugins-1113bbcd92d85b85579aa7feef511241e58fb0f5.tar.gz
merged with mastercheck_snmp_fixes
Diffstat (limited to 'gl/stat.c')
-rw-r--r--gl/stat.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gl/stat.c b/gl/stat.c
index 66637837..da6a9862 100644
--- a/gl/stat.c
+++ b/gl/stat.c
@@ -1,5 +1,5 @@
1/* Work around platform bugs in stat. 1/* Work around platform bugs in stat.
2 Copyright (C) 2009-2025 Free Software Foundation, Inc. 2 Copyright (C) 2009-2026 Free Software Foundation, Inc.
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as 5 it under the terms of the GNU Lesser General Public License as
@@ -42,14 +42,7 @@ orig_stat (const char *filename, struct stat *buf)
42#endif 42#endif
43 43
44/* Specification. */ 44/* Specification. */
45#ifdef __osf__ 45#include <sys/stat.h>
46/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
47 eliminates this include because of the preliminary #include <sys/stat.h>
48 above. */
49# include "sys/stat.h"
50#else
51# include <sys/stat.h>
52#endif
53 46
54#include "stat-time.h" 47#include "stat-time.h"
55 48
@@ -119,7 +112,7 @@ rpl_stat (char const *name, struct stat *buf)
119 <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */ 112 <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */
120 113
121 /* To ease portability. Like in open.c. */ 114 /* To ease portability. Like in open.c. */
122 if (strcmp (name, "/dev/null") == 0) 115 if (streq (name, "/dev/null"))
123 name = "NUL"; 116 name = "NUL";
124 117
125 /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13> 118 /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
@@ -294,8 +287,7 @@ rpl_stat (char const *name, struct stat *buf)
294 if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) 287 if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
295 { 288 {
296 const char *last_dot = NULL; 289 const char *last_dot = NULL;
297 const char *p; 290 for (const char *p = info.cFileName; *p != '\0'; p++)
298 for (p = info.cFileName; *p != '\0'; p++)
299 if (*p == '.') 291 if (*p == '.')
300 last_dot = p; 292 last_dot = p;
301 if (last_dot != NULL) 293 if (last_dot != NULL)