Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tests/LTbasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ int main(int argc, /* argument count */
(void)PrtMsg("usage: [-h]", Pn);
PrtMsgX(" -h print help (this panel)", Pn, cleanup, xv);
}
(void)snprintf(buf, sizeof(buf), LT_INODE_FORMAT,
LT_INODE_VALUE(UINT64_C(4294967296)));
if (strcmp(buf, "4294967296"))
PrtMsgX("ERROR!!! large inode formatting failed", Pn, cleanup, 1);
/*
* See if lsof can be executed and can access kernel memory.
*/
Expand Down Expand Up @@ -342,8 +346,8 @@ static char *tstlsof(char **texec, /* result of the executable test */
pem = cem;
break;
}
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64,
(uint64_t)cwdsb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(cwdsb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
if ((tmpdc.maj == cwddc.maj) && (tmpdc.min == cwddc.min) &&
(tmpdc.unit == cwddc.unit) && !strcmp(inop->v, ibuf)) {
Expand All @@ -369,8 +373,8 @@ static char *tstlsof(char **texec, /* result of the executable test */
pem = cem;
break;
}
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64,
(uint64_t)kmemsb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(kmemsb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
if ((tmpdc.maj == kmemdc.maj) && (tmpdc.min == kmemdc.min) &&
(tmpdc.unit == kmemdc.unit) && !strcmp(inop->v, ibuf)) {
Expand All @@ -394,8 +398,8 @@ static char *tstlsof(char **texec, /* result of the executable test */
pem = cem;
break;
}
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64,
(uint64_t)lsofsb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(lsofsb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
if ((tmpdc.maj == lsofdc.maj) && (tmpdc.min == lsofdc.min) &&
(tmpdc.unit == lsofdc.unit) && !strcmp(inop->v, ibuf)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/LTbigf.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ static int tstwlsof(int tt, /* test type -- i.e., TST_* */
if ((stdc.maj != lsofdc.maj) || (stdc.min != lsofdc.min) ||
(stdc.unit != lsofdc.unit))
break;
(void)snprintf(buf, sizeof(buf) - 1, "%llu",
(unsigned long long)sb.st_ino);
(void)snprintf(buf, sizeof(buf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(sb.st_ino));
buf[sizeof(buf) - 1] = '\0';
if (strcmp(inop->v, buf))
break;
Expand Down
3 changes: 2 additions & 1 deletion tests/LTdnlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ int main(int argc, /* argument count */
}
if ((em = ConvStatDev(&sb.st_dev, &cwddc)))
PrtMsgX(em, Pn, cleanup, 1);
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64, (uint64_t)sb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(sb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
/*
* Loop ATTEMPT_CT times.
Expand Down
3 changes: 2 additions & 1 deletion tests/LTlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ static char *tstwlsof(char *opt, /* extra lsof options */
if ((stdc.maj != lsofdc.maj) || (stdc.min != lsofdc.min) ||
(stdc.unit != lsofdc.unit))
break;
(void)snprintf(buf, sizeof(buf) - 1, "%u", (unsigned int)sb.st_ino);
(void)snprintf(buf, sizeof(buf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(sb.st_ino));
buf[sizeof(buf) - 1] = '\0';
if (strcmp(inop->v, buf))
break;
Expand Down
3 changes: 2 additions & 1 deletion tests/LTnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ static char *FindNFSfile(int *ff, /* file-found response receptor */
*/
if ((cem = ConvStatDev(&sb.st_dev, &stdc)))
PrtMsgX(cem, Pn, cleanup, 1);
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%u", (unsigned int)sb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(sb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
(void)snprintf(nlkbuf, sizeof(nlkbuf) - 1, "%d", (int)sb.st_nlink);
nlkbuf[sizeof(nlkbuf) - 1] = '\0';
Expand Down
3 changes: 2 additions & 1 deletion tests/LTnlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ int main(int argc, /* argument count */
*/
if ((em = ConvStatDev(&tfsb.st_dev, &tfdc)))
PrtMsgX(em, Pn, cleanup, 1);
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64, (uint64_t)tfsb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(tfsb.st_ino));
ibuf[sizeof(szbuf) - 1] = '\0';
(void)snprintf(xlnk, sizeof(xlnk) - 1, "%d", (int)tfsb.st_nlink);
ibuf[sizeof(szbuf) - 1] = '\0';
Expand Down
3 changes: 2 additions & 1 deletion tests/LTszoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ static char *testlsof(int tt, /* test type -- TYTST_* symbol */
*/
if ((cem = ConvStatDev(&sb.st_dev, &stdc)))
PrtMsgX(buf, Pn, cleanup, 1);
(void)snprintf(ibuf, sizeof(ibuf) - 1, "%" PRIu64, (uint64_t)sb.st_ino);
(void)snprintf(ibuf, sizeof(ibuf) - 1, LT_INODE_FORMAT,
LT_INODE_VALUE(sb.st_ino));
ibuf[sizeof(ibuf) - 1] = '\0';
/*
* Complete the option vector and start lsof execution.
Expand Down
3 changes: 3 additions & 0 deletions tests/LsofTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
# include <signal.h>
# include <inttypes.h>

# define LT_INODE_FORMAT "%" PRIu64
# define LT_INODE_VALUE(ino) ((uint64_t)(ino))

# include <sys/types.h>

# if defined(LT_DIAL_linux) && LT_VERS >= 414014
Expand Down
Loading