diff options
| author | Po Lu | 2023-02-24 21:18:35 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-24 21:18:35 +0800 |
| commit | b91e8ada70ed1ddc40b43d1c5d606197bbdcb48b (patch) | |
| tree | 329cf8b2490402a58715b1552c48857bb3b86425 /src | |
| parent | 4aaa6fd24cf702bbeac249f2eca5deb414767870 (diff) | |
| download | emacs-b91e8ada70ed1ddc40b43d1c5d606197bbdcb48b.tar.gz emacs-b91e8ada70ed1ddc40b43d1c5d606197bbdcb48b.zip | |
Fix auto-revert-mode on Android
* src/inotify.c (Finotify_add_watch): Handle asset files.
Diffstat (limited to 'src')
| -rw-r--r-- | src/inotify.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/inotify.c b/src/inotify.c index 7562ffb1701..b2a48884efa 100644 --- a/src/inotify.c +++ b/src/inotify.c | |||
| @@ -419,6 +419,7 @@ IN_ONESHOT */) | |||
| 419 | int wd = -1; | 419 | int wd = -1; |
| 420 | uint32_t imask = aspect_to_inotifymask (aspect); | 420 | uint32_t imask = aspect_to_inotifymask (aspect); |
| 421 | uint32_t mask = imask | IN_MASK_ADD | IN_EXCL_UNLINK; | 421 | uint32_t mask = imask | IN_MASK_ADD | IN_EXCL_UNLINK; |
| 422 | char *name; | ||
| 422 | 423 | ||
| 423 | CHECK_STRING (filename); | 424 | CHECK_STRING (filename); |
| 424 | 425 | ||
| @@ -432,7 +433,23 @@ IN_ONESHOT */) | |||
| 432 | } | 433 | } |
| 433 | 434 | ||
| 434 | encoded_file_name = ENCODE_FILE (filename); | 435 | encoded_file_name = ENCODE_FILE (filename); |
| 435 | wd = inotify_add_watch (inotifyfd, SSDATA (encoded_file_name), mask); | 436 | name = SSDATA (encoded_file_name); |
| 437 | |||
| 438 | #if defined HAVE_ANDROID && !defined ANDROID_STUBIFY | ||
| 439 | /* If FILENAME actually lies in a special directory, return now | ||
| 440 | instead of letting inotify fail. These directories cannot | ||
| 441 | receive file notifications as they are read only. */ | ||
| 442 | |||
| 443 | if (strcmp (name, "/assets") | ||
| 444 | || strcmp (name, "/assets/") | ||
| 445 | || strcmp (name, "/content") | ||
| 446 | || strcmp (name, "/content/") | ||
| 447 | || strncmp (name, "/assets/", sizeof "/assets") | ||
| 448 | || strncmp (name, "/content", sizeof "/content")) | ||
| 449 | return Qnil; | ||
| 450 | #endif | ||
| 451 | |||
| 452 | wd = inotify_add_watch (inotifyfd, name, mask); | ||
| 436 | if (wd < 0) | 453 | if (wd < 0) |
| 437 | report_file_notify_error ("Could not add watch for file", filename); | 454 | report_file_notify_error ("Could not add watch for file", filename); |
| 438 | 455 | ||