mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Revert "IPC: Check headers."
This reverts commit 4a3559e0b2724202914d97e527b8d9b2d7d4f041.
This commit is contained in:
parent
1424002087
commit
69d7208ade
@ -210,7 +210,6 @@ AC_CHECK_HEADERS(sys/utsname.h)
|
||||
AC_CHECK_HEADERS(stdint.h inttypes.h)
|
||||
AC_CHECK_HEADERS(locale.h pwd.h)
|
||||
AC_CHECK_HEADERS(termios.h)
|
||||
AC_CHECK_HEADERS(sys/ipc.h sys/sem.h sys/shm.h)
|
||||
|
||||
AC_CHECK_HEADERS(sys/epoll.h, [HAVE_SYS_EPOLL_H=yes])
|
||||
|
||||
|
@ -54,9 +54,7 @@
|
||||
#include "util/file.h"
|
||||
#include "util/memdebug.h"
|
||||
#include "util/memory.h"
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
#include "util/sem.h"
|
||||
#endif
|
||||
#include "viewer/dump/dump.h"
|
||||
#include "viewer/text/festival.h"
|
||||
#include "viewer/text/marks.h"
|
||||
@ -117,7 +115,6 @@ check_cwd(void)
|
||||
static void
|
||||
init_master_ipc(void)
|
||||
{
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
struct string filename;
|
||||
key_t k1, k2, k3;
|
||||
|
||||
@ -135,13 +132,11 @@ init_master_ipc(void)
|
||||
shared_mem = shmat(shared_mem_ipc, NULL, 0);
|
||||
}
|
||||
done_string(&filename);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
init_slave_ipc(void)
|
||||
{
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
struct string filename;
|
||||
key_t k1, k2, k3;
|
||||
|
||||
@ -157,13 +152,11 @@ init_slave_ipc(void)
|
||||
shared_mem = shmat(shared_mem_ipc, NULL, 0);
|
||||
}
|
||||
done_string(&filename);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
done_ipc(void)
|
||||
{
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
if (shared_mem)
|
||||
shmdt(shared_mem);
|
||||
if (master_sem >= 0)
|
||||
@ -171,7 +164,6 @@ done_ipc(void)
|
||||
if (slave_sem >= 0)
|
||||
sem_close(slave_sem);
|
||||
/* shared_mem_ipc will be automatically done by sem_close() */
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -41,9 +41,7 @@
|
||||
#include "util/hash.h"
|
||||
#include "util/lists.h"
|
||||
#include "util/memory.h"
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
#include "util/sem.h"
|
||||
#endif
|
||||
#include "util/string.h"
|
||||
|
||||
extern int master_sem;
|
||||
@ -673,11 +671,11 @@ get_mime_handler_mailcap_common(unsigned char *type)
|
||||
static struct mime_handler *
|
||||
get_mime_handler_mailcap(unsigned char *type, struct terminal *term)
|
||||
{
|
||||
struct mime_handler *handler = NULL;
|
||||
struct mime_handler *handler;
|
||||
unsigned char *desc, *data;
|
||||
int block, len;
|
||||
|
||||
if (!term || term->master || slave_sem == -1)
|
||||
if (!term || term->master)
|
||||
return get_mime_handler_mailcap_common(type);
|
||||
|
||||
len = strlen(type) + 1;
|
||||
@ -689,20 +687,16 @@ get_mime_handler_mailcap(unsigned char *type, struct terminal *term)
|
||||
memcpy(data + 2, type, len);
|
||||
hard_write(term->fdout, data, len + 2);
|
||||
fmem_free(data);
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
if (!shared_mem)
|
||||
return NULL;
|
||||
shared_mem[0] = '\0'; /* For unexpected death of slave. */
|
||||
|
||||
sem_signal(slave_sem);
|
||||
sem_wait(master_sem);
|
||||
if (!*shared_mem)
|
||||
if (!shared_mem || !*shared_mem)
|
||||
return NULL;
|
||||
desc = strchr(shared_mem, '\0') + 1;
|
||||
block = (shared_mem[4095] > 0);
|
||||
handler = init_mime_handler(shared_mem, desc, mailcap_mime_module.name,
|
||||
get_mailcap_ask(), block);
|
||||
if (handler) handler->copiousoutput = shared_mem[4095] & 1;
|
||||
#endif
|
||||
return handler;
|
||||
}
|
||||
|
||||
@ -710,7 +704,6 @@ get_mime_handler_mailcap(unsigned char *type, struct terminal *term)
|
||||
void
|
||||
get_slave_mailcap(unsigned char *type)
|
||||
{
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
sem_wait(slave_sem);
|
||||
if (shared_mem) {
|
||||
struct mailcap_entry *entry;
|
||||
@ -755,7 +748,6 @@ get_slave_mailcap(unsigned char *type)
|
||||
}
|
||||
end:
|
||||
sem_signal(master_sem);
|
||||
#endif
|
||||
}
|
||||
|
||||
const struct mime_backend mailcap_mime_backend = {
|
||||
|
@ -567,9 +567,7 @@ has_nul_byte:
|
||||
|
||||
if (fg == 3) {
|
||||
/* Mailcap */
|
||||
#ifdef CONFIG_MAILCAP
|
||||
get_slave_mailcap(path.source);
|
||||
#endif
|
||||
goto next_round;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ or use of these programs.
|
||||
|
||||
#include "elinks.h"
|
||||
|
||||
#if defined(HAVE_SYS_IPC_H) && defined(HAVE_SYS_SEM_H) && defined(HAVE_SYS_SHM_H)
|
||||
#include "util/sem.h"
|
||||
|
||||
extern int shared_mem_ipc;
|
||||
@ -312,4 +311,3 @@ sem_op(int id, int value)
|
||||
semop(id, &op_op[0], 1);
|
||||
/* err_sys("sem_op error"); */
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user