summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/tests/fsync.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/tests/fsync.c
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/tests/fsync.c')
-rw-r--r--nsprpub/pr/tests/fsync.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/nsprpub/pr/tests/fsync.c b/nsprpub/pr/tests/fsync.c
index 01c71c4c6..ee2eeff7d 100644
--- a/nsprpub/pr/tests/fsync.c
+++ b/nsprpub/pr/tests/fsync.c
@@ -39,25 +39,27 @@ int main(int argc, char **argv)
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
{
- if (PL_OPT_BAD == os) continue;
+ if (PL_OPT_BAD == os) {
+ continue;
+ }
switch (opt->option)
{
- case 0: /* Name of file to create */
- filename = opt->value;
- break;
- case 'S': /* Use sych option on file */
- flags |= PR_SYNC;
- break;
- case 'K': /* Size of file to write */
- filesize = atoi(opt->value);
- break;
- case 'c': /* Number of iterations */
- iterations = atoi(opt->value);
- break;
- case 'h': /* user wants some guidance */
- default: /* user needs some guidance */
- Help(); /* so give him an earful */
- return 2; /* but not a lot else */
+ case 0: /* Name of file to create */
+ filename = opt->value;
+ break;
+ case 'S': /* Use sych option on file */
+ flags |= PR_SYNC;
+ break;
+ case 'K': /* Size of file to write */
+ filesize = atoi(opt->value);
+ break;
+ case 'c': /* Number of iterations */
+ iterations = atoi(opt->value);
+ break;
+ case 'h': /* user wants some guidance */
+ default: /* user needs some guidance */
+ Help(); /* so give him an earful */
+ return 2; /* but not a lot else */
}
}
PL_DestroyOptState(opt);
@@ -76,8 +78,9 @@ int main(int argc, char **argv)
return 1;
}
- for (index = 0; index < sizeof(buffer); ++index)
+ for (index = 0; index < sizeof(buffer); ++index) {
buffer[index] = (PRUint8)index;
+ }
for (loops = 0; loops < iterations; ++loops)
{
@@ -89,12 +92,16 @@ int main(int argc, char **argv)
time = (PR_IntervalNow() - time);
total += time;
- if (time < shortest) shortest = time;
- else if (time > longest) longest = time;
+ if (time < shortest) {
+ shortest = time;
+ }
+ else if (time > longest) {
+ longest = time;
+ }
if (0 != PR_Seek(file, 0, PR_SEEK_SET))
{
- PL_FPrintError(err, "Rewinding file");
- return 1;
+ PL_FPrintError(err, "Rewinding file");
+ return 1;
}
}