Просмотр исходного кода

* Port [2425] to 1.2.12
* Added a new error code (22) which displays if attempting to run binary before using -C.


svn: 3089

Bryan Drewery 20 лет назад
Родитель
Сommit
d8af97b693
4 измененных файлов с 8 добавлено и 1 удалено
  1. 1 0
      doc/UPDATES
  2. 3 0
      src/conf.c
  3. 2 0
      src/shell.c
  4. 2 1
      src/shell.h

+ 1 - 0
doc/UPDATES

@@ -127,6 +127,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed some segfaults with tempfiles
 * Update binaries can now be stored in bins/ within the hub's binary directory.
 * If a tempdir suddenly becomes unavailable, a new one is now immediately sought out.
+* Added a new error code (20) which displays if attempting to run binary before using -C.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 3 - 0
src/conf.c

@@ -657,6 +657,9 @@ void prep_homedir(bool error)
 int
 parseconf(bool error)
 {
+  if (error && conf.uid == -1 && !conf.uname)
+    werr(ERR_NOTINIT);
+
   if (!conf.username)
     str_redup(&conf.username, my_username());
 

+ 2 - 0
src/shell.c

@@ -688,6 +688,8 @@ char *werr_tostr(int errnum)
     return STR("There is no username set. Please set one in the binary config with ./binary -C");
   case ERR_NOBOT:
     return STR("I have no bot record but received -B???");
+  case ERR_NOTINIT:
+    return STR("Binary data is not initialized; try ./binary -C");
   default:
     return "Unforseen error";
   }

+ 2 - 1
src/shell.h

@@ -21,7 +21,8 @@
 #define ERR_NOBOT	19
 #define ERR_NOUSERNAME	20
 #define ERR_NOHOMEDIR	21
-#define ERR_MAX         22
+#define ERR_NOTINIT	22
+#define ERR_MAX         23
 
 #define EMAIL_OWNERS    BIT0
 #define EMAIL_TEAM      BIT1