/** A random value used in child context for authentication. */
uint32_t afs_socket_cookie;
+/** The mutex protecting the shared memory area containing the mmd struct. */
+int mmd_mutex;
+
/* global variables for server-internal use */
static FILE *logfile;
/** The file containing user information (public key, permissions). */
static char *user_list_file = NULL;
-static int mmd_mutex, mmd_shm_id;
+static int mmd_shm_id;
static pid_t afs_pid;
-/** The task resposible for server command handling. */
+/** The task responsible for server command handling. */
struct server_command_task {
/** TCP port on which para_server listens for connections. */
int listen_fd;
exit(EXIT_FAILURE);
}
-/**
- * Lock the shared memory area containing the mmd struct.
- *
- * \sa semop(2), struct misc_meta_data.
- */
-void mmd_lock(void)
-{
- mutex_lock(mmd_mutex);
-}
-
-/**
- * Unlock the shared memory area containing the mmd struct.
- *
- * \sa semop(2), struct misc_meta_data.
- */
-
-void mmd_unlock(void)
-{
- mutex_unlock(mmd_mutex);
-}
-
static void parse_config(int override)
{
char *home = para_homedir();
int ret;
status_refresh();
- mmd_unlock();
+ mutex_unlock(mmd_mutex);
ret = para_select(max_fileno + 1, readfds, writefds, timeout_tv);
- mmd_lock();
+ mutex_lock(mmd_mutex);
return ret;
}
.select_function = server_select
};
server_init(argc, argv);
- mmd_lock();
+ mutex_lock(mmd_mutex);
ret = schedule(&s);
if (ret < 0) {
PARA_EMERG_LOG("%s\n", para_strerror(-ret));