[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] patch: SPC & netsync
On Tue, Oct 30, 2001 at 05:24:17PM -0500, Matthew C. Weigel wrote:
> On Tue, 30 Oct 2001, Andrew Arensburger wrote:
> > Thanks! I've applied the patch and uploaded the latest snapshot.
>
> Any word on the close()s in slp.c?
Currently, io_close both closes the file descriptor and cleans
up after the various protocols.
As has been reported in another thread, the cleanup code
doesn't happen correctly (it always cleans up SLP and PADP, even when
those protocols aren't used, and never cleans up netsync, even when it
is used), so I figure the Right Thing is to split io_close into two
methods: io_close should just "close the file descriptor," whatever
that means for the current protocol stack, and io_tini should clean up
the currently-used protocols. io_tini should be the very last method
called.
Once this happens, it should be safe to replace the bogus
close(pconn->fd)s with io_close(pconn)s.
If anyone wants to do the above and submit a patch, that'd be
keen, since a) I'm busier than usual at orkplace, and b) life seems to
be throwing a lot of Shiny Things(tm) at me to distract me.
Oh, and while I'm sending mail, allow me to tap into the
list's creative juices:
I've just split the monolithic usage string into multiple
strings:
const char *usage_msg[] = {
N_("Modes:\n"),
N_("\t-ms:\tSynchronize (default).\n"),
N_("\t-mI:\tInitialize.\n"),
N_("\t-t <devtype>:\tPort type [serial|usb|net].\n"),
/* ... */
NULL
};
int i;
printf(_("Usage: %s [options] <mode> <mode args>\n"), argv[0]);
for (i = 0; usage_msg[i] != NULL; i++)
printf("%s", _(usage_msg[i]));
This is for two reasons: 1) gcc 3.0 complains about strings
longer than 509 characters. 2) This way, if a new option is added,
then for non-English-speaking users, the whole usage string doesn't
suddenly become obsolete: they'll get most of the usage string in
their native language, and only the new option's string in English
(until someone gets around to translating it).
The problem with the above is that the string "serial|usb|net"
should not be translated, since it lists literal strings. Can anyone
suggest a good solution? Would vprintf() help?
--
Andrew Arensburger This message *does* represent the
arensb@ooblick.com views of ooblick.com
Sleeping till noon is a start.
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.