|
|
4c2a32f |
From 2f1dcbb75a96f5e12ed56c665b3bdd48d4bf6011 Mon Sep 17 00:00:00 2001
|
|
|
4c2a32f |
From: Pino Toscano <toscano.pino@tiscali.it>
|
|
|
4c2a32f |
Date: Thu, 12 Feb 2015 23:03:28 +0100
|
|
|
4c2a32f |
Subject: [PATCH] services: use PATH_MAX instead of FILENAME_MAX
|
|
|
4c2a32f |
|
|
|
4c2a32f |
In a Linux-specific code, use PATH_MAX instead of FILENAME_MAX as
|
|
|
4c2a32f |
buffer size for getcwd().
|
|
|
4c2a32f |
---
|
|
|
4c2a32f |
services/logging.cpp | 3 ++-
|
|
|
4c2a32f |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
4c2a32f |
|
|
|
4c2a32f |
diff --git a/services/logging.cpp b/services/logging.cpp
|
|
|
4c2a32f |
index 4291f0c..c476a97 100644
|
|
|
4c2a32f |
--- a/services/logging.cpp
|
|
|
4c2a32f |
+++ b/services/logging.cpp
|
|
|
4c2a32f |
@@ -25,6 +25,7 @@
|
|
|
4c2a32f |
#include "logging.h"
|
|
|
4c2a32f |
#include <fstream>
|
|
|
4c2a32f |
#include <signal.h>
|
|
|
4c2a32f |
+#include <limits.h>
|
|
|
4c2a32f |
#ifdef __linux__
|
|
|
4c2a32f |
#include <dlfcn.h>
|
|
|
4c2a32f |
#endif
|
|
|
4c2a32f |
@@ -63,7 +64,7 @@ void setup_debug(int level, const string &filename, const string &prefix)
|
|
|
4c2a32f |
#ifdef __linux__
|
|
|
4c2a32f |
|
|
|
4c2a32f |
if (fname[0] != '/') {
|
|
|
4c2a32f |
- char buf[FILENAME_MAX];
|
|
|
4c2a32f |
+ char buf[PATH_MAX];
|
|
|
4c2a32f |
|
|
|
4c2a32f |
if (getcwd(buf, sizeof(buf))) {
|
|
|
4c2a32f |
fname.insert(0, "/");
|