aboutsummaryrefslogtreecommitdiff
path: root/databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2019-04-12 13:04:58 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2019-04-12 13:04:58 +0000
commit5f0593e970ce542847deaabd7179b6e816f83169 (patch)
tree9d3ec8187e366ecb394d9820dad5da0cc77204cf /databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp
parentc1c546150714fa57efcb4284c8e25c8f8c0d2089 (diff)
downloadports-5f0593e970ce542847deaabd7179b6e816f83169.tar.gz
ports-5f0593e970ce542847deaabd7179b6e816f83169.zip
Notes
Diffstat (limited to 'databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp')
-rw-r--r--databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp b/databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp
index 9619048abadc..69cc268496c4 100644
--- a/databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp
+++ b/databases/foundationdb/files/patch-fdbmonitor_fdbmonitor.cpp
@@ -1,6 +1,6 @@
---- fdbmonitor/fdbmonitor.cpp.orig 2019-01-09 22:28:32 UTC
+--- fdbmonitor/fdbmonitor.cpp.orig 2019-04-09 00:11:05 UTC
+++ fdbmonitor/fdbmonitor.cpp
-@@ -35,6 +35,10 @@
+@@ -37,6 +37,10 @@
#include <linux/limits.h>
#endif
@@ -11,7 +11,7 @@
#ifdef __APPLE__
#include <sys/event.h>
#include <mach/mach.h>
-@@ -72,7 +76,7 @@
+@@ -77,7 +81,7 @@
#ifdef __linux__
typedef fd_set* fdb_fd_set;
@@ -20,7 +20,7 @@
typedef int fdb_fd_set;
#endif
-@@ -83,7 +87,7 @@ void monitor_fd( fdb_fd_set list, int fd, int* maxfd,
+@@ -88,7 +92,7 @@ void monitor_fd( fdb_fd_set list, int fd, int* maxfd,
FD_SET( fd, list );
if ( fd > *maxfd )
*maxfd = fd;
@@ -29,7 +29,7 @@
/* ignore maxfd */
struct kevent ev;
EV_SET( &ev, fd, EVFILT_READ, EV_ADD, 0, 0, cmd );
-@@ -94,7 +98,7 @@ void monitor_fd( fdb_fd_set list, int fd, int* maxfd,
+@@ -99,7 +103,7 @@ void monitor_fd( fdb_fd_set list, int fd, int* maxfd,
void unmonitor_fd( fdb_fd_set list, int fd ) {
#ifdef __linux__
FD_CLR( fd, list );
@@ -38,7 +38,7 @@
struct kevent ev;
EV_SET( &ev, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL );
kevent( list, &ev, 1, NULL, 0, NULL ); // FIXME: check?
-@@ -188,7 +192,7 @@ const char* get_value_multi(const CSimpleIni& ini, con
+@@ -193,7 +197,7 @@ const char* get_value_multi(const CSimpleIni& ini, con
}
double timer() {
@@ -47,7 +47,7 @@
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return double(ts.tv_sec) + (ts.tv_nsec * 1e-9);
-@@ -824,7 +828,7 @@ void read_child_output( Command* cmd, int pipe_idx, fd
+@@ -912,7 +916,7 @@ void read_child_output( Command* cmd, int pipe_idx, fd
}
}
@@ -56,16 +56,16 @@
void watch_conf_dir( int kq, int* confd_fd, std::string confdir ) {
struct kevent ev;
std::string original = confdir;
-@@ -841,7 +845,7 @@ void watch_conf_dir( int kq, int* confd_fd, std::strin
+@@ -929,7 +933,7 @@ void watch_conf_dir( int kq, int* confd_fd, std::strin
std::string child = confdir;
/* Find the nearest existing ancestor */
- while( (*confd_fd = open( confdir.c_str(), O_EVTONLY )) < 0 && errno == ENOENT ) {
+ while( (*confd_fd = open( confdir.c_str(), O_RDONLY )) < 0 && errno == ENOENT ) {
child = confdir;
- confdir = parentDirectory(confdir);
+ confdir = parentDirectory(confdir, false);
}
-@@ -878,7 +882,7 @@ void watch_conf_file( int kq, int* conff_fd, const cha
+@@ -966,7 +970,7 @@ void watch_conf_file( int kq, int* conff_fd, const cha
}
/* Open and watch */
@@ -74,16 +74,16 @@
if ( *conff_fd >= 0 ) {
EV_SET( &ev, *conff_fd, EVFILT_VNODE, EV_ADD | EV_CLEAR, NOTE_WRITE | NOTE_ATTRIB, 0, NULL );
kevent( kq, &ev, 1, NULL, 0, NULL );
-@@ -985,7 +989,7 @@ std::unordered_map<int, std::unordered_set<std::string
+@@ -1170,7 +1174,7 @@ int main(int argc, char** argv) {
+ // testPathOps(); return -1;
- int main(int argc, char** argv) {
std::string lockfile = "/var/run/fdbmonitor.pid";
- std::string _confpath = "/etc/foundationdb/foundationdb.conf";
+ std::string _confpath = std::string(PREFIX) + "/etc/foundationdb/foundationdb.conf";
std::vector<const char *> additional_watch_paths;
-@@ -1067,7 +1071,7 @@ int main(int argc, char** argv) {
+@@ -1252,7 +1256,7 @@ int main(int argc, char** argv) {
/* only linux needs this, but... */
int maxfd = 0;
@@ -92,7 +92,7 @@
fd_set rfds;
watched_fds = &rfds;
-@@ -1082,12 +1086,12 @@ int main(int argc, char** argv) {
+@@ -1267,12 +1271,12 @@ int main(int argc, char** argv) {
CSimpleIniA* ini = NULL;
if (daemonize) {
@@ -107,7 +107,7 @@
#pragma GCC diagnostic pop
#endif
log_err("daemon", errno, "Unable to daemonize");
-@@ -1140,12 +1144,12 @@ int main(int argc, char** argv) {
+@@ -1325,12 +1329,12 @@ int main(int argc, char** argv) {
snprintf(pid_buf, sizeof(pid_buf), "%d\n", getpid());
ssize_t ign = write(lockfile_fd, pid_buf, strlen(pid_buf));
@@ -122,7 +122,7 @@
int kq = kqueue();
if ( kq < 0 ) {
log_err( "kqueue", errno, "Unable to create kqueue" );
-@@ -1176,7 +1180,7 @@ int main(int argc, char** argv) {
+@@ -1361,7 +1365,7 @@ int main(int argc, char** argv) {
#endif
@@ -131,7 +131,7 @@
signal(SIGCHLD, child_handler);
#endif
-@@ -1190,11 +1194,11 @@ int main(int argc, char** argv) {
+@@ -1375,11 +1379,11 @@ int main(int argc, char** argv) {
/* normal will be restored in our main loop in the call to
pselect, but none blocks all signals while processing events */
sigprocmask(SIG_SETMASK, &full_mask, &normal_mask);
@@ -145,7 +145,7 @@
struct stat st_buf;
struct timespec mtimespec;
-@@ -1253,7 +1257,7 @@ int main(int argc, char** argv) {
+@@ -1438,7 +1442,7 @@ int main(int argc, char** argv) {
load_conf(confpath.c_str(), uid, gid, &normal_mask, &rfds, &maxfd);
reload_additional_watches = false;
@@ -154,7 +154,7 @@
load_conf( confpath.c_str(), uid, gid, &normal_mask, watched_fds, &maxfd );
watch_conf_file( kq, &conff_fd, confpath.c_str() );
watch_conf_dir( kq, &confd_fd, confdir );
-@@ -1291,7 +1295,7 @@ int main(int argc, char** argv) {
+@@ -1476,7 +1480,7 @@ int main(int argc, char** argv) {
if(nfds == 0) {
reload = true;
}