diff options
| author | Po Lu | 2023-06-08 14:04:31 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-08 14:04:31 +0800 |
| commit | b1bd40dce197d2938426d1ec33cebd3d51ccc8cf (patch) | |
| tree | 610f3c3b69d878d62584ad6da607c2c5499bd45f /src/filelock.c | |
| parent | f2b2863ff7380e7c3c31662ca7615bd8edb83440 (diff) | |
| download | emacs-b1bd40dce197d2938426d1ec33cebd3d51ccc8cf.tar.gz emacs-b1bd40dce197d2938426d1ec33cebd3d51ccc8cf.zip | |
Update Android port
* src/android.c (android_is_special_directory): New function.
(android_get_asset_name, android_content_name_p)
(android_get_content_name):
* src/android.h (android_is_special_directory)
(JNI_STACK_ALIGNMENT_PROLOGUE):
* src/fileio.c (check_mutable_filename):
* src/filelock.c (WTMP_FILE, make_lock_file_name):
* src/inotify.c (IN_ONLYDIR, Finotify_add_watch): Factor out
checks against asset and content directories to that function.
Diffstat (limited to 'src/filelock.c')
| -rw-r--r-- | src/filelock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/filelock.c b/src/filelock.c index be551fc876f..cbbcc016b27 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -75,6 +75,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 75 | #define WTMP_FILE "/var/log/wtmp" | 75 | #define WTMP_FILE "/var/log/wtmp" |
| 76 | #endif | 76 | #endif |
| 77 | 77 | ||
| 78 | #ifdef HAVE_ANDROID | ||
| 79 | #include "android.h" /* For `android_is_special_directory'. */ | ||
| 80 | #endif /* HAVE_ANDROID */ | ||
| 81 | |||
| 78 | /* Normally use a symbolic link to represent a lock. | 82 | /* Normally use a symbolic link to represent a lock. |
| 79 | The strategy: to lock a file FN, create a symlink .#FN in FN's | 83 | The strategy: to lock a file FN, create a symlink .#FN in FN's |
| 80 | directory, with link data USER@HOST.PID:BOOT. This avoids a single | 84 | directory, with link data USER@HOST.PID:BOOT. This avoids a single |
| @@ -673,14 +677,10 @@ make_lock_file_name (Lisp_Object fn) | |||
| 673 | 677 | ||
| 674 | name = SSDATA (fn); | 678 | name = SSDATA (fn); |
| 675 | 679 | ||
| 676 | if (strcmp (name, "/assets") | 680 | if (android_is_special_directory (name, "/assets") |
| 677 | || strcmp (name, "/assets/") | 681 | || android_is_special_directory (name, "/content")) |
| 678 | || strcmp (name, "/content") | ||
| 679 | || strcmp (name, "/content/") | ||
| 680 | || strncmp (name, "/assets/", sizeof "/assets") | ||
| 681 | || strncmp (name, "/content/", sizeof "/content")) | ||
| 682 | return Qnil; | 682 | return Qnil; |
| 683 | #endif | 683 | #endif /* defined HAVE_ANDROID && !defined ANDROID_STUBIFY */ |
| 684 | 684 | ||
| 685 | lock_file_name = call1 (Qmake_lock_file_name, fn); | 685 | lock_file_name = call1 (Qmake_lock_file_name, fn); |
| 686 | 686 | ||