[578] in arla-drinkers

home help back first fref pref prev next nref lref last post

minor bug-fixes for "fs" command

daemon@ATHENA.MIT.EDU (Chuck Lever)
Thu Feb 4 23:11:00 1999

From owner-arla-drinkers@stacken.kth.se Fri Feb 05 04:10:59 1999
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 29831 invoked from network); 5 Feb 1999 04:10:57 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
  by bloom-picayune.mit.edu with SMTP; 5 Feb 1999 04:10:57 -0000
Received: (from majordom@localhost)
	by sundance.stacken.kth.se (8.8.8/8.8.8) id FAA06327
	for arla-drinkers-list; Fri, 5 Feb 1999 05:06:36 +0100 (MET)
Received: from elixir.e.kth.se (1073744992@elixir.e.kth.se [130.237.48.5])
	by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id FAA06323
	for <arla-drinkers@stacken.kth.se>; Fri, 5 Feb 1999 05:06:29 +0100 (MET)
Received: from zinfandel.e.kth.se (zinfandel.e.kth.se [130.237.48.172])
	by elixir.e.kth.se (8.9.2/8.9.2) with ESMTP id FAA18581
	for <arla-drinkers@stacken.kth.se>; Fri, 5 Feb 1999 05:06:28 +0100 (MET)
Received: (from lha@localhost)
	by zinfandel.e.kth.se (8.9.2/8.9.2) id FAA22055
	for arla-drinkers@stacken.kth.se; Fri, 5 Feb 1999 05:05:44 +0100 (MET)
Date: Thu, 4 Feb 1999 18:57:25 -0500 (EST)
From: Chuck Lever <cel@monkey.org>
To: Magnus Ahltorp <map@stacken.kth.se>
Subject: minor bug-fixes for "fs" command
In-Reply-To: <ixdiudjyw50.fsf@scup.pdc.kth.se>
Message-ID: <Pine.BSF.3.96.990204183323.1540A-100000@naughty.monkey.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Lines: 48
Xref: mumrik.nada.kth.se mail.private:1697
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk

i found a couple of minor bugs while slugging away at the bigger problem.
these are all against the 0.21 source tree.

first, "fs wscell" returned the workstation's cellname followed by core
garbage.  the fix is to change line 2747 of arlad/messages.c:

old:
    return xfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
                                        cellname, strlen(cellname));

new:
    return xfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
                                        cellname, strlen(cellname)+1);

this is how the viocfilecellname() function already handles passing the
workstation's cellname back to a client application.

second, the "newcell" subcommand causes "fs" command to exit quietly when
an error occurs. the exiting is caused by "return 1;".  i rewrote
newcell_cmd to use "return 0;" and to print a reasonable error message.
the only other subcommand of "fs" that uses "return 1;" is "quit."

static int
newcell_cmd (int argc, char **argv)
{
    int ret;

    argc--;
    argv++;

    if (argc < 2) {
        printf ("newcell: Missing required parameter `-cell'\n");
        return 0;
    }

    ret = fs_newcell (argv[0], argc - 1, argv + 1);
    if (ret)
        fprintf (stderr, "newcell: %s\n", strerror(ret));

    return 0;
}

        - Chuck Lever
--
corporate:      <chuckl@netscape.com>
personal:       <chucklever@netscape.net> or <cel@monkey.org>

home help back first fref pref prev next nref lref last post