[Commits] r633 - in trunk/daemon: . src
new-commit at lists.openvcp.org
new-commit at lists.openvcp.org
Thu Dec 11 20:49:50 UTC 2008
Author: ftx
Date: 2008-12-11 20:49:49 +0000 (Thu, 11 Dec 2008)
New Revision: 633
Modified:
trunk/daemon/openvcpd.conf
trunk/daemon/src/get.c
Log:
resolve symlink of run file
Closes: #229
Modified: trunk/daemon/openvcpd.conf
===================================================================
--- trunk/daemon/openvcpd.conf 2008-10-05 16:09:24 UTC (rev 632)
+++ trunk/daemon/openvcpd.conf 2008-12-11 20:49:49 UTC (rev 633)
@@ -1,4 +1,4 @@
-IP=192.168.1.3
+IP=192.168.3.2
Port=6000
Password=test
@@ -20,7 +20,7 @@
# traffic will only be logged on the following interfaces
Ifaces=eth1
-# IFB Device that will be user for ingress traffic shaping
+# IFB Device that will be used for ingress traffic shaping
IfbDev=ifb0
# email address of the administrator
Modified: trunk/daemon/src/get.c
===================================================================
--- trunk/daemon/src/get.c 2008-10-05 16:09:24 UTC (rev 632)
+++ trunk/daemon/src/get.c 2008-12-11 20:49:49 UTC (rev 633)
@@ -145,8 +145,10 @@
{
struct ovcp_response_st *response;
struct ovcp_data_st *arg0;
- char *name, *runfile, *rescuefile;
-
+ char *name, *runfilelink, *rescuefile;
+ char runfile[BUF_SIZE];
+ int len;
+
arg0 = ovcp_request_get_arg(request, 0);
name = (char *)ovcp_data_get(arg0);
@@ -157,13 +159,25 @@
response = ovcp_response_new();
+
+
+
+
+
+ runfilelink = concat(global_settings.config_dir, "/", name, "/run", NULL);
+
+ runfile[0] = 0;
+ if ((len = readlink(runfilelink, runfile, sizeof(runfile)-1)) != -1)
+ runfile[len] = 0;
- runfile = concat(global_settings.run_dir, "/", name, NULL);
+ free(runfilelink);
+
+
if(file_exist(runfile))
ovcp_response_add_string(response, "Online");
else
ovcp_response_add_string(response, "Offline");
- free(runfile);
+
rescuefile = concat(global_settings.config_dir, "/", name, "/rescue", NULL);
if(file_exist(rescuefile))
More information about the Commits
mailing list