Changeset 97cdbaf5 for message.c


Ignore:
Timestamp:
Mar 11, 2012, 10:57:35 PM (12 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
a03a409
Parents:
1f39ded
git-author:
David Benjamin <davidben@mit.edu> (01/23/12 00:38:29)
git-committer:
David Benjamin <davidben@mit.edu> (03/11/12 22:57:35)
Message:
Rewrite call_filter to use g_spawn_async_with_pipes

This simplifies the error-handling code. Also fixes a bug where file
descriptors get double-closed in call_filter. Also adds a unit test. The
separate prog argument is removed to avoid having to deal with
G_SPAWN_FILE_AND_ARGV_ZERO, and since we don't really use it anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rbff1f22 r97cdbaf5  
    875875  if (owl_global_is_zcrypt(&g) && !strcasecmp(n->z_opcode, "crypt")) {
    876876    const char *argv[] = {
    877       "zcrypt",
     877      NULL,
    878878      "-D",
    879879      "-c", owl_message_get_class(m),
     
    887887
    888888    zcrypt = g_build_filename(owl_get_bindir(), "zcrypt", NULL);
    889 
    890     rv = call_filter(zcrypt, argv, owl_message_get_body(m), &out, &status);
     889    argv[0] = zcrypt;
     890
     891    rv = call_filter(argv, owl_message_get_body(m), &out, &status);
    891892    g_free(zcrypt);
    892893
Note: See TracChangeset for help on using the changeset viewer.