Print this page
11227 smb code needs smatch fixes

*** 9,18 **** --- 9,19 ---- * http://www.illumos.org/license/CDDL. */ /* * Copyright 2018 Nexenta Systems, Inc. All rights reserved. + * Copyright 2019 Joyent, Inc. */ /* * Test & debug program for oplocks *
*** 163,175 **** if (ofile->f_refcnt) { printf("open fid %d already opened\n"); return; } ! if (arg2 != NULL) ! strlcpy((char *)ofile->TargetOplockKey, arg2, SMB_LEASE_KEY_SZ); ofile->f_refcnt++; node->n_open_count++; smb_llist_insert_tail(&node->n_ofile_list, ofile); printf(" open %d OK\n", fid); --- 164,177 ---- if (ofile->f_refcnt) { printf("open fid %d already opened\n"); return; } ! if (arg2 != NULL) { ! (void) strlcpy((char *)ofile->TargetOplockKey, arg2, SMB_LEASE_KEY_SZ); + } ofile->f_refcnt++; node->n_open_count++; smb_llist_insert_tail(&node->n_ofile_list, ofile); printf(" open %d OK\n", fid);
*** 395,405 **** f->f_node = &test_node; } for (;;) { if (prompt) { ! fputs(prompt, stdout); fflush(stdout); } cmd = fgets(cmdbuf, sizeof (cmdbuf), stdin); if (cmd == NULL) --- 397,407 ---- f->f_node = &test_node; } for (;;) { if (prompt) { ! (void) fputs(prompt, stdout); fflush(stdout); } cmd = fgets(cmdbuf, sizeof (cmdbuf), stdin); if (cmd == NULL)
*** 407,427 **** if (cmd[0] == '#') continue; if (prompt == NULL) { /* Put commands in the output too. */ ! fputs(cmdbuf, stdout); } cmd = strtok_r(cmd, sep, &savep); if (cmd == NULL) continue; /* * Commands with no args */ if (0 == strcmp(cmd, "help")) { ! fputs(helpstr, stdout); continue; } if (0 == strcmp(cmd, "show")) { do_show(); --- 409,429 ---- if (cmd[0] == '#') continue; if (prompt == NULL) { /* Put commands in the output too. */ ! (void) fputs(cmdbuf, stdout); } cmd = strtok_r(cmd, sep, &savep); if (cmd == NULL) continue; /* * Commands with no args */ if (0 == strcmp(cmd, "help")) { ! (void) fputs(helpstr, stdout); continue; } if (0 == strcmp(cmd, "show")) { do_show();