Parcourir la source

改时区设置的bug

guohui il y a 1 an
Parent
commit
ff6d8a67d3
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 1 1
      pro/src/appweb_handle.c
  2. 2 2
      pro/src/common.c

+ 1 - 1
pro/src/appweb_handle.c

@@ -4005,7 +4005,7 @@ static void serviceManagement(void *conn)
         {
             char buf[128];
             memset(buf, 0, sizeof(buf));
-            sprintf(buf, "product id = %d timezone err.", _globalNTPManager.product_id);
+            sprintf(buf, "product id = %d timezone: %d, timezone err.", _globalNTPManager.product_id, value);
             log_e(buf);
             return;
         }      

+ 2 - 2
pro/src/common.c

@@ -327,7 +327,7 @@ int set_local_timeandzone(struct tm* t, int zone)
             sprintf(buf, "ln -sf /usr/share/zoneinfo/Asia/Amman /etc/localtime");
             break;
         case 5:
-            sprintf(buf, "ln -sf /usr/share/zoneinfo/Asia/Bangkok /etc/localtime");
+            sprintf(buf, "ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime");
             break;
         case 6:
             sprintf(buf, "ln -sf /usr/share/zoneinfo/Asia/Dhaka /etc/localtime");
@@ -351,7 +351,7 @@ int set_local_timeandzone(struct tm* t, int zone)
             sprintf(buf, "ln -sf /usr/share/zoneinfo/Pacific/Fiji /etc/localtime");
             break;
     }
-    //system("ln -sf /usr/share/zoneinfo/UTC /etc/localtime");
+    system(buf);
 
     //time_t now=time(NULL)+zone*3600;
     //struct tm* ptm = localtime(&t);