* Europagate, 1995
*
* $Log: urp.c,v $
- * Revision 1.28 1995/04/19 13:19:09 adam
+ * Revision 1.31 1995/05/01 12:43:38 adam
+ * First work on resource monitor program.
+ *
+ * Revision 1.30 1995/04/20 16:10:47 adam
+ * Modified to work with non-blocking zass-api. Not using non-blocking
+ * facility yet.
+ *
+ * Revision 1.29 1995/04/19 16:01:58 adam
+ * Some hacks to get the FIFO communication work!! Isn't reliable.
+ * Resource gw.account added - default account info.
+ *
+ * Revision 1.28 1995/04/19 13:19:09 adam
* New command: account - for authentication.
*
* Revision 1.27 1995/04/19 10:46:19 adam
#include <unistd.h>
#include <fcntl.h>
+#include <lgets.h>
#include <ttyemit.h>
#include <strqueue.h>
#include "kernel.h"
tty_emit (*s++);
}
-int lgets (char *buf, int max, int fd)
-{
- int r, no = 0;
-
- --max;
- while (no <= max)
- {
- if ((r=read (fd, buf+no, 1)) != 1)
- {
- if (r == -1)
- gw_log (GW_LOG_WARN|GW_LOG_ERRNO, KERNEL_LOG, "read fail");
- buf[no] = '\0';
- return 0;
- }
- if (buf[no] == 1)
- return 0;
- if (buf[no++] == '\n')
- break;
- }
- buf[no] = '\0';
- return 1;
-}
-
int reopen_target (void)
{
const char *v;
if (info.zass)
gw_log (GW_LOG_WARN, KERNEL_LOG, "Zass free...");
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reopen_target");
- info.zass = zass_open (info.hostname, info.port, *info.account ?
- info.account : NULL);
+ info.zass = zass_open (info.hostname, info.port, NULL, /* complete */
+ *info.account ? info.account : NULL);
if (!info.zass)
{
gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Cannot connect to target %s:%d",