Mercurial > hg > nnchat
comparison main.c @ 714:66b9d7b861d1
Update to match the th_mkdir_path() API changes in th-libs.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 14 Dec 2022 01:39:18 +0200 |
parents | 93d0e1547842 |
children | 6d527b60fb02 |
comparison
equal
deleted
inserted
replaced
713:93d0e1547842 | 714:66b9d7b861d1 |
---|---|
1268 { | 1268 { |
1269 (void) conn; | 1269 (void) conn; |
1270 (void) buf; | 1270 (void) buf; |
1271 th_ioctx *ctx = NULL; | 1271 th_ioctx *ctx = NULL; |
1272 int cfgfd = -1; | 1272 int cfgfd = -1; |
1273 | 1273 int res; |
1274 if (!th_mkdir_path(setConfigDir, 0)) | 1274 |
1275 { | 1275 if ((res = th_mkdir_path(setConfigDir, 0)) != THERR_OK) |
1276 printMsgQ(currWin, "Could not create configuration file directory '%s'.\n", | 1276 { |
1277 setConfigDir); | 1277 printMsgQ(currWin, "Could not create configuration file directory '%s': %s\n", |
1278 setConfigDir, th_error_str(res)); | |
1278 goto error; | 1279 goto error; |
1279 } | 1280 } |
1280 | 1281 |
1281 if ((ctx = th_io_new(&th_stdio_io_ops, setConfigFile, "w")) == NULL) | 1282 if ((ctx = th_io_new(&th_stdio_io_ops, setConfigFile, "w")) == NULL) |
1282 { | 1283 { |
2115 } | 2116 } |
2116 else | 2117 else |
2117 if ((sdata.flags & TH_IS_WRITABLE) == 0) | 2118 if ((sdata.flags & TH_IS_WRITABLE) == 0) |
2118 { | 2119 { |
2119 #ifdef TH_PLAT_WINDOWS | 2120 #ifdef TH_PLAT_WINDOWS |
2120 if (!th_mkdir_path(optLogPath, 0)) | 2121 if ((ret = th_mkdir_path(optLogPath, 0)) != THERR_OK) |
2121 { | 2122 { |
2122 THERR("Could not create log file directory '%s'.\n", | 2123 THERR("Could not create log file directory '%s': %s\n", |
2123 optLogPath); | 2124 optLogPath, th_error_str(ret)); |
2124 goto err_exit; | 2125 goto err_exit; |
2125 } | 2126 } |
2126 #else | 2127 #else |
2127 THERR("The log file path '%s' is not writable.\n", | 2128 THERR("The log file path '%s' is not writable.\n", |
2128 optLogPath); | 2129 optLogPath); |
2129 goto err_exit; | 2130 goto err_exit; |
2130 #endif | 2131 #endif |
2131 } | 2132 } |
2132 } | 2133 } |
2133 else | 2134 else |
2134 if (!th_mkdir_path(optLogPath, 0)) | 2135 if ((ret = th_mkdir_path(optLogPath, 0)) != THERR_OK) |
2135 { | 2136 { |
2136 THERR("Could not create log file directory '%s'.\n", | 2137 THERR("Could not create log file directory '%s': %s\n", |
2137 optLogPath); | 2138 optLogPath, th_error_str(ret)); |
2138 goto err_exit; | 2139 goto err_exit; |
2139 } | 2140 } |
2140 } | 2141 } |
2141 | 2142 |
2142 // Parse command line arguments | 2143 // Parse command line arguments |