Portál AbcLinuxu, 12. května 2024 19:06
I. `pkg-config --cflags glib-2.0` -D_REENTRANT -c -o jcr_deliver.o jcr_deliver.c gcc -O2 -g -Wall -I../lib -I. `pkg-config --cflags glib-2.0` -D_REENTRANT -c -o jcr_elements.o jcr_elements.c jcr_elements.c: In function `jcr_start_element': jcr_elements.c:42: parse error before `char' jcr_elements.c:44: `hashbuf' undeclared (first use in this function) jcr_elements.c:44: (Each undeclared identifier is reported only once jcr_elements.c:44: for each function it appears in.) jcr_elements.c:47: parse error before `cur' jcr_elements.c:48: `cur' undeclared (first use in this function) jcr_elements.c: In function `jcr_end_element': jcr_elements.c:103: parse error before `parent' jcr_elements.c:104: `parent' undeclared (first use in this function) make[1]: *** [jcr_elements.o] Error 1tak jsem prohledaval konference a nasel jsem stejnej dotaz a u nej odpoved s patchem, se kterym vsak vubecnevim co delat. pochpil jsem ze to je porovnani puvodniho a upravenyho souboru, ale jak to slepit dohromady nevim. predem dik za kazdou radu vypada to takhle:
diff -ur jcr-0.1.2//jcomp/jcr_elements.c jcr-0.1.2-compiles//jcomp/jcr_elements.c --- jcr-0.1.2//jcomp/jcr_elements.cTue Nov 4 22:42:42 2003 +++ jcr-0.1.2-compiles//jcomp/jcr_elements.cThu Jan 29 17:56:50 2004 @@ -32,6 +32,8 @@ if (strncasecmp(name, "/stream:/stream", 13) == 0) { char *pass = xmlnode_get_data(xmlnode_get_tag(jcr->config,"secret")); int i = 0; + char hashbuf[41]; + xmlnode cur; if (attrib == NULL) return; while (attrib[i] != '\0') { if (strncasecmp(attrib[i], "id", 2) == 0) @@ -39,12 +41,11 @@ i += 2; } p = pool_new(); - char hashbuf[41]; // log_debug(JDBG, "%s = '%s'", attrib[i], attrib[i+1]); shahash_r(spools(p, attrib[i + 1], pass, p), hashbuf); /* Build a handshake packet */ - xmlnode cur = xmlnode_new_tag("handshake"); + cur = xmlnode_new_tag("handshake"); xmlnode_insert_cdata(cur, hashbuf, -1); /* Transmit handshake */ @@ -91,6 +92,7 @@ if (jcr->current == NULL) { g_io_channel_close(jcr->gio); } else { + xmlnode parent; if (strncasecmp(name, "stream:error", 12) == 0) { log_warn(JDBG, "%s", xmlnode2str(jcr->current)); g_io_channel_write_chars(jcr->gio, "xxxxxxx", 15, &bytes, NULL); @@ -100,7 +102,7 @@ break; } - xmlnode parent = xmlnode_get_parent(jcr->current); + parent = xmlnode_get_parent(jcr->current); if (parent == NULL) { x = xmlnode_dup(jcr->current); to = jid_new(x->p, xmlnode_get_attrib(x, "to")); diff -ur jcr-0.1.2//src/main.c jcr-0.1.2-compiles//src/main.c --- jcr-0.1.2//src/main.cSat Nov 1 17:27:21 2003 +++ jcr-0.1.2-compiles//src/main.cTue Feb 17 17:59:03 2004 @@ -34,11 +34,11 @@ struct stat st; char *config_file = NULL; pool p; - jcr = (jcr_instance)malloc(sizeof(_jcr_instance)); GThread *dthread; /* the packet delivery thread */ GMainLoop *gmain; /* the receive packet event loop */ + jcr = (jcr_instance)malloc(sizeof(_jcr_instance)); fprintf(stderr, "%s -- %s\n%s\n\n", _JCOMP_NAME, _JCOMP_VERS, _JCOMP_COPY); @@ -119,6 +119,8 @@ if (inBackground == 1) { + int fdlimit = 0, fd = 0; + if ((pid = fork()) == -1) { fprintf(stderr, "%s: Could not start in background\n", JDBG); exit(1); @@ -128,8 +130,7 @@ /* in child process .... process and terminal housekeeping */ setsid(); - int fdlimit = sysconf(_SC_OPEN_MAX); - int fd = 0; + fdlimit = sysconf(_SC_OPEN_MAX); while (fd < fdlimit) close(fd++); open("/dev/null",O_RDWR);
server-br:/home/zdenek# patch < patch can't find file to patch at input line 4 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- |diff -ur jcr-0.1.2//jcomp/jcr_elements.c jcr-0.1.2-compiles//jcomp/jcr_elements.c |--- jcr-0.1.2//jcomp/jcr_elements.cTue Nov 4 22:42:42 2003 |+++ jcr-0.1.2-compiles//jcomp/jcr_elements.cThu Jan 29 17:56:50 2004 -------------------------- File to patch: jcr-0.1.2/jcomp/jcr_elements.c patching file jcr-0.1.2/jcomp/jcr_elements.c Hunk #1 FAILED at 32. Hunk #2 FAILED at 41. Hunk #3 FAILED at 92. Hunk #4 FAILED at 102. 4 out of 4 hunks FAILED -- saving rejects to file jcr-0.1.2/jcomp/jcr_elements.c.rej
server-br:/home/zdenek/jcr-0.1.2# patch -p1 < patch patching file jcomp/jcr_elements.c Hunk #1 FAILED at 32. Hunk #2 FAILED at 41. Hunk #3 FAILED at 92. Hunk #4 FAILED at 102. 4 out of 4 hunks FAILED -- saving rejects to file jcomp/jcr_elements.c.rej server-br:/home/zdenek/jcr-0.1.2#
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.