Displaying 14 results from an estimated 14 matches for "cmdlen".
Did you mean:
cmd_len
2001 May 12
4
Erase the source file open; specify a tempfile name option
.../* Struct for addargs */
@@ -206,9 +207,11 @@
uid_t userid;
int errs, remin, remout;
int pflag, iamremote, iamrecursive, targetshouldbedirectory;
+int eraseflag;
+char *tmpfn = "";
-#define CMDNEEDS 64
-char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
+char *cmd;
+int cmdlen;
int response(void);
void rsource(char *, struct stat *);
@@ -236,7 +239,7 @@
addargs(&args, "-oFallBackToRsh no");
fflag = tflag = 0;
- while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:")) != -1)
+ while ((ch = getopt(argc, argv, "dfprtvBCc:i:P:q46S:o:ET:&...
2007 Dec 12
0
Revisiting sftp tab completion patch
...[0][x] != list[y][x])
+ break;
+
+ matchlen = x;
+ }
+
+ if (matchlen > strlen(word)) {
+ char *tmp = xstrdup(list[0]);
+
+ tmp[matchlen] = NULL;
+ return (tmp);
+ }
+ }
+
+ return (xstrdup(word));
+}
+
+
+int
+complete_cmd_parse(EditLine *el, char *cmd)
+{
+ u_int y, count = 0, cmdlen;
+ char **list;
+
+ if (cmd == NULL)
+ return (0);
+
+ list = xcalloc((sizeof(cmds) / sizeof(*cmds)), sizeof(char *));
+ cmdlen = strlen(cmd);
+ for (y = 0; cmds[y].c; y++) {
+ if (!strncasecmp(cmd, cmds[y].c, cmdlen))
+ list[count++] = xstrdup(cmds[y].c);
+
+ list[count] = NULL;
+ }
+
+ if...
2006 Apr 01
0
sftp tab completion patch (First release - NOT FOR INCLUDING YET)
...gt; strlen(word)) {
+ char *tmp = xstrdup(list[0]);
+
+ tmp[matchlen] = NULL;
+ return (tmp);
+ }
+ } else
+ return (xstrdup(list[0]));
+
+ return (NULL);
+}
+
+
+int
+complete_cmd_parse(EditLine *el, char *cmd)
+{
+ int y, count = 0;
+ #define MAXLIST 20
+ char *list[MAXLIST], *tmp;
+ int cmdlen = strlen(cmd);
+
+ for (y = 0; cmds[y].c; y++) {
+ if (!strncasecmp(cmd, cmds[y].c, cmdlen)) {
+ list[count++] = xstrdup(cmds[y].c);
+ if (count >= MAXLIST)
+ fatal("Exceeded MAXLIST.");
+ }
+ list[count] = NULL;
+ }
+
+ if (count > 0) {
+ tmp = complete_ambiguous(cmd, l...
2010 May 12
1
[PATCH] guestfish -i and virt-inspector work on filenames containing spaces (RHBZ#507810).
...mote_control ||
guestfs_get_selinux (g)) {
fprintf (stderr, _("%s: cannot use -i option with -a, -m, -N, "
@@ -379,44 +377,90 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- strcpy (cmd, "a=`virt-inspector");
+ char *cmd;
+ size_t cmdlen;
+ FILE *fp = open_memstream (&cmd, &cmdlen);
+ if (fp == NULL) {
+ perror ("open_memstream");
+ exit (EXIT_FAILURE);
+ }
+
+ //fprintf (fp, "virt-inspector");
+ fprintf (fp, "inspector/run-inspector-locally");
while (optind < a...
2008 Nov 22
0
[patch] [vuxml] net/wireshark: fix DoS in SMTP dissector
...le = NULL;
+
+ /*
+@@ -175,6 +171,7 @@
+ gint length_remaining;
+ gboolean eom_seen = FALSE;
+ gint next_offset;
++ gint loffset;
+ gboolean is_continuation_line;
+ int cmdlen;
+ fragment_data *frag_msg = NULL;
+@@ -217,21 +214,6 @@
+ * longer than what's in the buffer, so the "tvb_get_ptr()" call
+ * won't throw an exception.
+ */
+- linelen = tvb_find_line_end(tvb, offset, -1, &next_offset,
+- smtp_desegment &a...
2009 Oct 27
2
[PATCH 3/4] scsi-disk: Factor out SCSI command emulation
...SCSIDevice *d, uint32_t tag,
- uint8_t *buf, int lun)
+static int scsi_check_cdb_len(uint8_t *cdb, uint32_t *datalen, uint64_t *lba)
{
- SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
- uint64_t nb_sectors;
- uint64_t lba;
- uint32_t len;
- int cmdlen;
- int is_write;
- uint8_t command;
- uint8_t *outbuf;
- SCSIRequest *r;
+ int cmdlen = 0;
- command = buf[0];
- r = scsi_find_request(s, tag);
- if (r) {
- BADF("Tag 0x%x already in use\n", tag);
- scsi_cancel_io(d, tag);
- }
- /* ??? Tags ar...
2009 Oct 27
2
[PATCH 3/4] scsi-disk: Factor out SCSI command emulation
...SCSIDevice *d, uint32_t tag,
- uint8_t *buf, int lun)
+static int scsi_check_cdb_len(uint8_t *cdb, uint32_t *datalen, uint64_t *lba)
{
- SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
- uint64_t nb_sectors;
- uint64_t lba;
- uint32_t len;
- int cmdlen;
- int is_write;
- uint8_t command;
- uint8_t *outbuf;
- SCSIRequest *r;
+ int cmdlen = 0;
- command = buf[0];
- r = scsi_find_request(s, tag);
- if (r) {
- BADF("Tag 0x%x already in use\n", tag);
- scsi_cancel_io(d, tag);
- }
- /* ??? Tags ar...
2001 May 19
0
More scp changes
...(errno));
- break;
- }
- cwd_len = strlen(cwd);
- }
- len = cwd_len + strlen(src) + 2;
- src = xmalloc(len);
- snprintf(src, len, "%s/%s", cwd, argv[i]);
- }
- host = "localhost";
- suser = NULL;
+ host = suser = NULL;
}
len = strlen(src) + cmdlen + 20;
bp = xmalloc(len);
2020 Jul 07
0
[PATCH nbdkit] New filter: tar.
....redhat.com/archives/libguestfs/2020-July/msg00017.html
+ */
+static int
+calculate_offset_of_entry (struct nbdkit_next_ops *next_ops, void *nxdata)
+{
+ const size_t bufsize = 65536;
+ char output[] = "/tmp/tarXXXXXX";
+ int fd;
+ FILE *fp;
+ CLEANUP_FREE char *cmd = NULL;
+ size_t cmdlen = 0;
+ CLEANUP_FREE char *buf = NULL;
+ int64_t i, copysize;
+ bool scanned_ok = false;
+
+ assert (entry);
+
+ /* Temporary file to capture the output from the tar command. */
+ fd = mkstemp (output);
+ if (fd == -1) {
+ nbdkit_error ("mkstemp: %m");
+ return -1;
+ }
+ clo...
2020 Jul 07
3
[PATCH nbdkit] tar as a filter.
For review only, this needs some clean up and more tests.
My eyes are going cross-eyed looking at the calculate_offset_of_entry
function, so time to take a break ...
Rich.
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...fc host request queue
* @shost: scsi host rport attached to
* @job: bsg job to be processed
*/
static enum fc_dispatch_result
fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
struct fc_bsg_job *job)
{
struct fc_internal *i = to_fc_internal(shost->transportt);
int cmdlen = sizeof(uint32_t); /* start with length of msgcode */
int ret;
/* Validate the host command */
switch (job->request->msgcode) {
case FC_BSG_HST_ADD_RPORT:
cmdlen += sizeof(struct fc_bsg_host_add_rport);
break;
case FC_BSG_HST_DEL_RPORT:
cmdlen += sizeof(struct fc_bsg_host_del_rp...
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...fc host request queue
* @shost: scsi host rport attached to
* @job: bsg job to be processed
*/
static enum fc_dispatch_result
fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
struct fc_bsg_job *job)
{
struct fc_internal *i = to_fc_internal(shost->transportt);
int cmdlen = sizeof(uint32_t); /* start with length of msgcode */
int ret;
/* Validate the host command */
switch (job->request->msgcode) {
case FC_BSG_HST_ADD_RPORT:
cmdlen += sizeof(struct fc_bsg_host_add_rport);
break;
case FC_BSG_HST_DEL_RPORT:
cmdlen += sizeof(struct fc_bsg_host_del_rp...
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on
.export_descriptions and a new exportname filter. I think it is
now ready to check in.
Things I'd still like in 1.22:
- the file plugin should implement .list_exports (patch already posted,
but it needs rebasing on this series)
- the ext2 filter should override .list_exports when in exportname mode
- the nbd plugin should be
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by
improving libnbd to better test things, which in turn surfaced some
major memory leak problems in nbdsh that are now fixed). Many of the
patches are minor rebases from v2, with the biggest changes being
fallout from:
- patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export
- overall: this missed 1.22, so update