Rename cynagoradm to cynagoracli
authorJose Bollo <jose.bollo@iot.bzh>
Wed, 9 Oct 2019 15:34:23 +0000 (17:34 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Tue, 15 Oct 2019 20:06:24 +0000 (22:06 +0200)
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
src/CMakeLists.txt
src/main-cynagoracli.c [moved from src/main-cynagoradm.c with 98% similarity]

index b69c15f..bde17f6 100644 (file)
@@ -101,10 +101,10 @@ install(TARGETS cynagorad
         RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
 
 ###########################################
-# build and install cynagoradm
+# build and install cynagoracli
 ###########################################
-add_executable(cynagoradm main-cynagoradm.c expire.c)
-target_link_libraries(cynagoradm cynagora)
-install(TARGETS cynagoradm
+add_executable(cynagoracli main-cynagoracli.c expire.c)
+target_link_libraries(cynagoracli cynagora)
+install(TARGETS cynagoracli
         RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
 
similarity index 98%
rename from src/main-cynagoradm.c
rename to src/main-cynagoracli.c
index b668abb..db36243 100644 (file)
@@ -65,7 +65,7 @@ static
 const char
 helptxt[] =
        "\n"
-       "usage: cynadm [options]... [action [arguments]]\n"
+       "usage: cynagoracli [options]... [action [arguments]]\n"
        "\n"
        "otpions:\n"
        "       -s, --socket xxx      set the base xxx for sockets\n"
@@ -75,16 +75,16 @@ helptxt[] =
        "       -h, --help            print this help and exit\n"
        "       -v, --version         print the version and exit\n"
        "\n"
-       "When action is given, cynadm performs the action and exits.\n"
-       "Otherwise cynadm continuously read its input to get the actions.\n"
-       "For a list of actions tpe 'cynadm help'.\n"
+       "When action is given, cynagoracli performs the action and exits.\n"
+       "Otherwise cynagoracli continuously read its input to get the actions.\n"
+       "For a list of actions type 'cynagoracli help'.\n"
        "\n"
 ;
 
 static
 const char
 versiontxt[] =
-       "cynadm version 1.99.99\n"
+       "cynagoracli version 1.99.99\n"
 ;
 
 static
@@ -789,7 +789,7 @@ int main(int ac, char **av)
        for(;;) {
                rc = poll(fds, 2, -1);
                if (fds[0].revents & POLLIN) {
-                       rc = (int)read(0, buffer, sizeof buffer - bufill);
+                       rc = (int)read(0, &buffer[bufill], sizeof buffer - bufill);
                        if (rc == 0)
                                break;
                        if (rc > 0) {