Dont prevent kitty fro starting on failure to read macos-launch-services-cmdline

Fixes #8581
This commit is contained in:
Kovid Goyal
2025-04-27 10:16:40 +05:30
parent 45f4b8ec26
commit 41899aab14
2 changed files with 5 additions and 2 deletions

View File

@@ -45,8 +45,9 @@ get_argv_from(const char *filename, const char *argv0, argv_array *final_ans) {
size_t src_sz;
char* src = read_full_file(filename, &src_sz);
if (!src) {
if (errno == ENOENT || errno == ENOTDIR) return true;
fprintf(stderr, "Failed to read from %s ", filename); perror("with error");
return false;
return true;
}
ShlexState s = {0};
argv_array ans = {0};

View File

@@ -215,7 +215,9 @@ safe_read_stream(void* ptr, size_t size, FILE* stream) {
static char*
read_full_file(const char* filename, size_t *sz) {
FILE* file = fopen(filename, "rb");
FILE* file = NULL;
errno = EINTR;
while (file == NULL && errno == EINTR) file = fopen(filename, "rb");
if (!file) return NULL;
fseek(file, 0, SEEK_END);
unsigned long file_size = ftell(file);