ae44cd2e47cd8d719271fed804f21d475aae2d47
[openwrt/svn-archive/packages.git] / utils / bandwidthd / patches / 100-fix_config_file_location
1 --- bandwidthd-2.0.1/bandwidthd.c.orig 2008-05-09 10:06:37.000000000 -0500
2 +++ bandwidthd-2.0.1/bandwidthd.c 2008-05-09 10:32:54.000000000 -0500
3 @@ -255,22 +255,22 @@
4
5 openlog("bandwidthd", LOG_CONS, LOG_DAEMON);
6
7 - if (stat("./etc/bandwidthd.conf", &StatBuf))
8 + if (stat("/etc/bandwidthd.conf", &StatBuf))
9 {
10 chdir(INSTALL_DIR);
11 - if (stat("./etc/bandwidthd.conf", &StatBuf))
12 + if (stat("/etc/bandwidthd.conf", &StatBuf))
13 {
14 - printf("Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
15 - syslog(LOG_ERR, "Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
16 + printf("Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR);
17 + syslog(LOG_ERR, "Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR);
18 exit(1);
19 }
20 }
21
22 - bdconfig_in = fopen("./etc/bandwidthd.conf", "rt");
23 + bdconfig_in = fopen("/etc/bandwidthd.conf", "rt");
24 if (!bdconfig_in)
25 {
26 syslog(LOG_ERR, "Cannot open bandwidthd.conf");
27 - printf("Cannot open ./etc/bandwidthd.conf\n");
28 + printf("Cannot open /etc/bandwidthd.conf\n");
29 exit(1);
30 }
31 bdconfig_parse();