~ubuntu-branches/ubuntu/oneiric/irssi/oneiric

« back to all changes in this revision

Viewing changes to src/fe-common/core/fe-exec.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-05-05 15:50:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090505155050-aoqlnpes7che9rtd
Tags: 0.8.13-1ubuntu1
* Merge from debian unstable (LP: #372411), remaining changes:
  - debian/patches: 03firsttimer_text
    + Adapt it so it tells you about connecting to irc.ubuntu.com and
      joining #ubuntu instead of irc.debian.org and #debian.
  - debian/patches: 90irc-ubuntu-com
* Fixed debian/patches/90irc-ubuntu-com for new irssi.conf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "commands.h"
25
25
#include "pidwait.h"
26
26
#include "line-split.h"
 
27
#include "network.h"
27
28
#include "net-sendbuffer.h"
28
29
#include "misc.h"
29
30
#include "levels.h"
209
210
        /* check only the few most common signals, too much job to check
210
211
           them all. if we sometimes want more, procps-sources/proc/sig.c
211
212
           would be useful for copypasting */
212
 
        if (g_strcasecmp(name, "hup") == 0)
 
213
        if (g_ascii_strcasecmp(name, "hup") == 0)
213
214
                return SIGHUP;
214
 
        if (g_strcasecmp(name, "int") == 0)
 
215
        if (g_ascii_strcasecmp(name, "int") == 0)
215
216
                return SIGINT;
216
 
        if (g_strcasecmp(name, "term") == 0)
 
217
        if (g_ascii_strcasecmp(name, "term") == 0)
217
218
                return SIGTERM;
218
 
        if (g_strcasecmp(name, "kill") == 0)
 
219
        if (g_ascii_strcasecmp(name, "kill") == 0)
219
220
                return SIGKILL;
220
 
        if (g_strcasecmp(name, "usr1") == 0)
 
221
        if (g_ascii_strcasecmp(name, "usr1") == 0)
221
222
                return SIGUSR1;
222
 
        if (g_strcasecmp(name, "usr2") == 0)
 
223
        if (g_ascii_strcasecmp(name, "usr2") == 0)
223
224
                return SIGUSR2;
224
225
        return -1;
225
226
}
349
350
static void sig_exec_input_reader(PROCESS_REC *rec)
350
351
{
351
352
        char tmpbuf[512], *str;
352
 
        gsize recvlen;
353
 
        int err, ret;
 
353
        int recvlen;
 
354
        int ret;
354
355
 
355
356
        g_return_if_fail(rec != NULL);
356
357
 
357
 
        recvlen = 0;
358
 
        err = g_io_channel_read(rec->in, tmpbuf,
359
 
                                sizeof(tmpbuf), &recvlen);
360
 
        if (err != 0 && err != G_IO_ERROR_AGAIN && errno != EINTR)
361
 
                recvlen = -1;
362
 
 
 
358
        recvlen = net_receive(rec->in, tmpbuf, sizeof(tmpbuf));
363
359
        do {
364
360
                ret = line_split(tmpbuf, recvlen, &str, &rec->databuf);
365
361
                if (ret == -1) {
517
513
        rec->name = g_strdup(g_hash_table_lookup(optlist, "name"));
518
514
 
519
515
        level = g_hash_table_lookup(optlist, "level");
520
 
        rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level);
 
516
        rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL);
521
517
 
522
518
        rec->read_tag = g_input_add(rec->in, G_INPUT_READ,
523
519
                                    (GInputFunction) sig_exec_input_reader,