Ich denke, wenn die/data/open vorhanden ist, sollte Zeile 203 -1 mit ERRNO von eEXIST zurückgeben, und es sollte zu Zeile 211 gehen, um die Datei mit O_WRONLY zu öffnen. Aber es tat nicht!
280 /*
281 * TEMP_FAILURE_RETRY is defined by some, but not all, versions of
282 * . (Alas, it is not as standard as we'd hoped!) So, if it's
283 * not already defined, then define it here.
284 */
285 #ifndef TEMP_FAILURE_RETRY
286 /* Used to retry syscalls that can return EINTR. */
287 #define TEMP_FAILURE_RETRY(exp) ({ \
288 typeof (exp) _rc; \
289 do { \
290 _rc = (exp); \
291 } while (_rc == -1 && errno == EINTR); \
292 _rc; })
293 #endif
342 static __inline__ int adb_open_mode( const char* pathname, int options, int mode )
343 {
344 return TEMP_FAILURE_RETRY( open( pathname, options, mode ) );
345 }
Ich denke, es wird geöffnet , korrigieren Sie mich, wenn ich falsch liege.
Ich arbeite an einem eingebetteten Linux-System (Kernel-5.10.188), wobei ADBD im Zielsystem ausgeführt wird.[code]PS C:\Users\aa> adb push C:\test\open /data/ C:\test\open: 1 file pushed. 0.7 MB/s (17096 bytes in 0.023s) < /code> im Zielsystem, < /p> # ls /data/open -l -rw-rw-rw- 1 root root 17096 Mar 11 10:28 /data/open [/code] Die Funktion von handle_send_file () in File_Sync_Service.c lautet wie folgt (ich habe 3 Zeilen von Printf hinzugefügt) [code]196 static int handle_send_file(int s, char *path, mode_t mode, char *buffer) 197 { 198 syncmsg msg; 199 unsigned int timestamp = 0; 200 int fd; 201 202 printf("XXXXXX %s, path: %s, mode: %o\n", __func__, path, mode); 203 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 204 printf("XXXXX fd: %d, errno: %d\n", fd, errno); 205 if(fd < 0 && errno == ENOENT) { 206 mkdirs(path); 207 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 208 } 209 printf("XXXXX fd: %d, errno: %d\n", fd, errno); 210 if(fd < 0 && errno == EEXIST) { 211 fd = adb_open_mode(path, O_WRONLY, mode); 212 } 213 if(fd < 0) { 214 if(fail_errno(s)) 215 return -1; 216 fd = -1; 217 } < /code> Ich wurde verwirrt, nachdem ich die Codes gelesen hatte. < /p> 203 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 204 printf("XXXXX fd: %d, errno: %d\n", fd, errno); [/code] Ich denke, wenn die/data/open vorhanden ist, sollte Zeile 203 -1 mit ERRNO von eEXIST zurückgeben, und es sollte zu Zeile 211 gehen, um die Datei mit O_WRONLY zu öffnen. Aber es tat nicht![code]XXXXXX handle_send_file, path: /data/open, mode: 666 XXXXX fd: 17, errno: 0 XXXXX fd: 17, errno: 0 sync: waiting for command [/code] Ich habe erneut vom PC gedrückt und Got. [code]XXXXXX handle_send_file, path: /data/open, mode: 666 XXXXX fd: 17, errno: 0 XXXXX fd: 17, errno: 0 sync: waiting for command [/code] Es wird kein Fehler zurückgegeben, wenn der/data/open vorhanden ist! Ist das richtig und erwartet?[code]280 /* 281 * TEMP_FAILURE_RETRY is defined by some, but not all, versions of 282 * . (Alas, it is not as standard as we'd hoped!) So, if it's 283 * not already defined, then define it here. 284 */ 285 #ifndef TEMP_FAILURE_RETRY 286 /* Used to retry syscalls that can return EINTR. */ 287 #define TEMP_FAILURE_RETRY(exp) ({ \ 288 typeof (exp) _rc; \ 289 do { \ 290 _rc = (exp); \ 291 } while (_rc == -1 && errno == EINTR); \ 292 _rc; }) 293 #endif
342 static __inline__ int adb_open_mode( const char* pathname, int options, int mode ) 343 { 344 return TEMP_FAILURE_RETRY( open( pathname, options, mode ) ); 345 } [/code] Ich denke, es wird geöffnet , korrigieren Sie mich, wenn ich falsch liege.[code]#include #include #include #include #include
int adb_open_mode(const char *path, int flags, mode_t mode) { return open(path, flags, mode); }
Gab es in Java 17 eine undokumentierte Änderung des Gzip -Verhaltens? Ich habe mir die Java -Update -Notizen angesehen und sie werden nicht die Komprimierung von Gzip -Änderungen erwähnt. Ich habe...
Ich habe eine Funktion in Arduino geschrieben, um zufällige Zahlen mit der gleichen Anzahl von binären Bits wie die Eingabe zu generieren. Bei Verwendung von random () mit berechneten Bereichen...
Ich habe kürzlich einen Unternehmensserver eingerichtet, um meine Website online zu stellen.
Zuvor wurde diese Website auf meinem PC mit XAMPP mit PHP 5 gehostet; Jetzt habe ich Windows Server 2019...
Ich bin mit einem Problem in Bezug auf die p-Multiselect konfrontiert. Da wir im Projekt an vielen Stellen diese p-multiselect verwenden, aber auf dem mobilen Gerät etwas ändern müssen. Dies ist...