From 4c50a1d16342c29b303546773d27c796fa445626 Mon Sep 17 00:00:00 2001 From: zzh <838331105@qq.com> Date: Tue, 13 Jan 2026 15:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8=E6=A3=80?= =?UTF-8?q?=E6=B5=8Bota?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_mac_pdd.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/update_mac_pdd.c b/update_mac_pdd.c index 9739850..669f6f0 100644 --- a/update_mac_pdd.c +++ b/update_mac_pdd.c @@ -708,13 +708,17 @@ static int get_remote_file_md5(const char* host, const char* remote_path, char* FILE* fp = popen(cmd, "r"); if (!fp) { - fprintf(stderr, "无法执行SSH命令获取远程文件MD5\n"); + // SSH命令执行失败,黄灯快速闪烁表示错误 + start_yellow_fast_blink(); + sleep(2); return -1; } if (fgets(out_md5, (int)out_size, fp) == NULL) { pclose(fp); - fprintf(stderr, "无法读取远程文件MD5值\n"); + // 无法读取MD5,黄灯快速闪烁表示错误 + start_yellow_fast_blink(); + sleep(2); return -1; } @@ -728,7 +732,9 @@ static int get_remote_file_md5(const char* host, const char* remote_path, char* // 验证MD5格式(32个十六进制字符) if (strlen(out_md5) != 32) { - fprintf(stderr, "远程文件MD5格式无效: %s\n", out_md5); + // MD5格式错误,黄灯快速闪烁表示错误 + start_yellow_fast_blink(); + sleep(2); return -1; } @@ -746,7 +752,9 @@ static int copy_remote_directory(const char* host, const char* remote_dir, const int result = system(cmd); if (result != 0) { - fprintf(stderr, "复制远程目录失败,返回码: %d\n", result); + // 复制失败,黄灯快速闪烁表示错误 + start_yellow_fast_blink(); + sleep(2); return -1; } @@ -775,7 +783,6 @@ static int check_and_update_pigeon_dll(void) { // 获取远程文件MD5 if (get_remote_file_md5(remote_host, remote_file, remote_md5, sizeof(remote_md5)) != 0) { - fprintf(stderr, "获取远程文件MD5失败\n"); return -1; } fprintf(stdout, "远程文件MD5: %s\n", remote_md5); @@ -832,7 +839,6 @@ static int check_program_upgrade(char** argv) { // 获取远程程序文件MD5 if (get_remote_file_md5(remote_host, remote_program, remote_md5, sizeof(remote_md5)) != 0) { - fprintf(stderr, "获取远程程序文件MD5失败,跳过升级检查\n"); return 0; // 不影响主程序运行 } fprintf(stdout, "远程程序MD5: %s\n", remote_md5);