Return error in mosquitto_pub -l if compiled without threading.

This commit is contained in:
Roger A. Light
2018-08-16 11:06:58 +01:00
parent 0a4810286b
commit dde005ef92
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -336,6 +336,14 @@ int main(int argc, char *argv[])
password = cfg.password;
quiet = cfg.quiet;
#ifndef WITH_THREADING
if(cfg.pub_mode == MSGMODE_STDIN_LINE){
fprintf(stderr, "Error: '-l' mode not available, threading support has not been compiled in.\n");
free(buf);
return 1;
}
#endif
if(cfg.pub_mode == MSGMODE_STDIN_FILE){
if(load_stdin()){
fprintf(stderr, "Error loading input from stdin.\n");
+1
View File
@@ -194,6 +194,7 @@ endif
ifeq ($(WITH_THREADING),yes)
LIB_LIBS:=$(LIB_LIBS) -lpthread
LIB_CFLAGS:=$(LIB_CFLAGS) -DWITH_THREADING
CLIENT_CFLAGS:=$(CLIENT_CFLAGS) -DWITH_THREADING
endif
ifeq ($(WITH_SOCKS),yes)