]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: sink: replace S_IRUSR, S_IWUSR with their octal value
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Aug 2022 13:03:12 +0000 (15:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Aug 2022 13:03:12 +0000 (15:03 +0200)
The build broke on freebsd with S_IRUSR undefined after commit 0b8e9ceb1
("MINOR: ring: add support for a backing-file"). Maybe another include
is needed there, but the point is that we really don't care about these
symbolic names, file modes are more readable as 0600 than via these
cryptic names anyway, so let's go back to 0600. This will teach me not
to try to make things too clean.

No backport is needed.

src/sink.c

index 5432c4db7616e83aa92ca424a94221fc2a78bcba..ffb6cf1f97912c74527b887cfbf57cfc38e766a1 100644 (file)
@@ -862,7 +862,7 @@ int cfg_parse_ring(const char *file, int linenum, char **args, int kwm)
                        goto err;
                }
 
-               fd = open(backing, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR);
+               fd = open(backing, O_RDWR | O_CREAT, 0600);
                if (fd < 0) {
                        ha_alert("parsing [%s:%d] : cannot open backing-file '%s' for ring '%s': %s.\n", file, linenum, backing, cfg_sink->name, strerror(errno));
                        err_code |= ERR_ALERT | ERR_FATAL;