[mw-devel] MW3 r1350 - in trunk/src: . client webclient
welshbyte at sucs.org
welshbyte at sucs.org
Fri Nov 1 22:09:51 GMT 2013
Author: welshbyte
Date: 2013-11-01 22:09:51 +0000 (Fri, 01 Nov 2013)
New Revision: 1350
Modified:
trunk/src/client/main.c
trunk/src/files.c
trunk/src/files.h
trunk/src/webclient/mwpoll.c
Log:
Get rid of open_incoming_fifo() and close_fifo(). Approaching a point where files.{c,h} can disappear...
Modified: trunk/src/client/main.c
===================================================================
--- trunk/src/client/main.c 2013-11-01 18:29:19 UTC (rev 1349)
+++ trunk/src/client/main.c 2013-11-01 22:09:51 UTC (rev 1350)
@@ -73,7 +73,7 @@
int autochat=0;
int autowho=0;
const char *autoexec_arg;
-char *targethost = NULL;
+const char *targethost = NULL;
struct alarm *timeout_event_1, *timeout_event_2;
extern int script_terminate;
@@ -581,7 +581,7 @@
timeout_event_1 = timeout_event_2 = NULL;
alarm_init();
- close_fifo();
+ ipc_close();
/* display all new messages for given user */
if (msguser_num>-1 && god_mode())
@@ -657,8 +657,11 @@
}
/* we need to be logged in before we connect to the server */
- open_incoming_fifo(targethost);
+ if (targethost == NULL)
+ targethost = "localhost";
+ ipc_connect(targethost);
+
if ((s_quiet(user->special) || u_god(user->status)) && qflag)
{
extern int talker_logontype;
@@ -965,7 +968,7 @@
free(user);
free(fold);
- close_fifo();
+ ipc_close();
exit(0);
}
Modified: trunk/src/files.c
===================================================================
--- trunk/src/files.c 2013-11-01 18:29:19 UTC (rev 1349)
+++ trunk/src/files.c 2013-11-01 22:09:51 UTC (rev 1350)
@@ -16,21 +16,6 @@
#include "files.h"
#include "ipc.h"
-#define MAXPIPELENGTH 2048
-
-void open_incoming_fifo(const char *host)
-{
- if (host == NULL)
- ipc_connect("localhost");
- else
- ipc_connect(host);
-}
-
-void close_fifo(void)
-{
- ipc_close();
-}
-
void Lock_File(int f)
{
errno=0;
Modified: trunk/src/files.h
===================================================================
--- trunk/src/files.h 2013-11-01 18:29:19 UTC (rev 1349)
+++ trunk/src/files.h 2013-11-01 22:09:51 UTC (rev 1350)
@@ -6,8 +6,6 @@
#define FOLDERFILE STATEDIR"/folders.bb"
-void open_incoming_fifo(const char *host);
-void close_fifo(void);
void Lock_File(int f);
void Unlock_File(int f);
int openfolderfile(int mode);
Modified: trunk/src/webclient/mwpoll.c
===================================================================
--- trunk/src/webclient/mwpoll.c 2013-11-01 18:29:19 UTC (rev 1349)
+++ trunk/src/webclient/mwpoll.c 2013-11-01 22:09:51 UTC (rev 1350)
@@ -65,26 +65,23 @@
int main(int argc, char ** argv)
{
- char *username;
int opt;
int channel = 0;
int debug = 0;
int dbsession = 0;
int autocreate = 0;
- char *hostname = NULL;
+ const char *username = NULL;
+ const char *hostname = NULL;
char passwd[80];
char rawpw[80];
- username = strdup("Arthur2");
while ((opt=getopt(argc,argv,"u:c:h:dsa"))!=-1) {
switch (opt) {
case 'u':
- if (username) free(username);
- username = strdup(optarg);
+ username = optarg;
break;
case 'h':
- if (hostname) free(hostname);
- hostname = strdup(optarg);
+ hostname = optarg;
break;
case 'c':
channel = atoi(optarg);
@@ -215,11 +212,13 @@
}
/* load us up */
- open_incoming_fifo(hostname);
+ if (hostname == NULL)
+ hostname = "localhost";
+ ipc_connect(hostname);
open_command_socket();
if (user->status&(1<<3)) {
- close_fifo();
+ ipc_close();
close_cmd();
return 0;
}
@@ -270,7 +269,7 @@
user->idletime=time(0);
update_user(user,userposn);
- close_fifo();
+ ipc_close();
close_cmd();
return 0;
}
More information about the mw-devel
mailing list