~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to slirp/misc.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
}
67
67
#endif
68
68
 
69
 
#ifndef HAVE_INET_ATON
70
 
int
71
 
inet_aton(cp, ia)
72
 
        const char *cp;
73
 
        struct in_addr *ia;
74
 
{
75
 
        u_int32_t addr = inet_addr(cp);
76
 
        if (addr == 0xffffffff)
77
 
                return 0;
78
 
        ia->s_addr = addr;
79
 
        return 1;
80
 
}
81
 
#endif
82
 
 
83
69
/*
84
70
 * Get our IP address and put it in our_addr
85
71
 */
97
83
            our_addr.s_addr = loopback_addr.s_addr;
98
84
}
99
85
 
100
 
#if SIZEOF_CHAR_P == 8
101
 
 
102
 
struct quehead_32 {
103
 
        u_int32_t qh_link;
104
 
        u_int32_t qh_rlink;
105
 
};
106
 
 
107
 
inline void
108
 
insque_32(a, b)
109
 
        void *a;
110
 
        void *b;
111
 
{
112
 
        register struct quehead_32 *element = (struct quehead_32 *) a;
113
 
        register struct quehead_32 *head = (struct quehead_32 *) b;
114
 
        element->qh_link = head->qh_link;
115
 
        head->qh_link = (u_int32_t)element;
116
 
        element->qh_rlink = (u_int32_t)head;
117
 
        ((struct quehead_32 *)(element->qh_link))->qh_rlink
118
 
        = (u_int32_t)element;
119
 
}
120
 
 
121
 
inline void
122
 
remque_32(a)
123
 
        void *a;
124
 
{
125
 
        register struct quehead_32 *element = (struct quehead_32 *) a;
126
 
        ((struct quehead_32 *)(element->qh_link))->qh_rlink = element->qh_rlink;
127
 
        ((struct quehead_32 *)(element->qh_rlink))->qh_link = element->qh_link;
128
 
        element->qh_rlink = 0;
129
 
}
130
 
 
131
 
#endif /* SIZEOF_CHAR_P == 8 */
132
 
 
133
86
struct quehead {
134
87
        struct quehead *qh_link;
135
88
        struct quehead *qh_rlink;
183
136
        (*ex_ptr)->ex_fport = port;
184
137
        (*ex_ptr)->ex_addr = addr;
185
138
        (*ex_ptr)->ex_pty = do_pty;
186
 
        (*ex_ptr)->ex_exec = strdup(exec);
 
139
        (*ex_ptr)->ex_exec = (do_pty == 3) ? exec : strdup(exec);
187
140
        (*ex_ptr)->ex_next = tmp_ptr;
188
141
        return 0;
189
142
}
304
257
{
305
258
        int s;
306
259
        struct sockaddr_in addr;
307
 
        int addrlen = sizeof(addr);
 
260
        socklen_t addrlen = sizeof(addr);
308
261
        int opt;
309
262
        int master = -1;
310
 
        char *argv[256];
 
263
        const char *argv[256];
311
264
#if 0
312
265
        char buff[256];
313
266
#endif
411
364
                   } while (c);
412
365
 
413
366
                argv[i] = 0;
414
 
                execvp(argv[0], argv);
 
367
                execvp(argv[0], (char **)argv);
415
368
 
416
369
                /* Ooops, failed, let's tell the user why */
417
370
                  {
418
371
                          char buff[256];
419
372
 
420
 
                          sprintf(buff, "Error: execvp of %s failed: %s\n",
421
 
                                  argv[0], strerror(errno));
 
373
                          snprintf(buff, sizeof(buff),
 
374
                                   "Error: execvp of %s failed: %s\n",
 
375
                                   argv[0], strerror(errno));
422
376
                          write(2, buff, strlen(buff)+1);
423
377
                  }
424
378
                close(0); close(1); close(2); /* XXX */