summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/tests/rmdir.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/rmdir.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/rmdir.c')
-rw-r--r--nsprpub/pr/tests/rmdir.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/nsprpub/pr/tests/rmdir.c b/nsprpub/pr/tests/rmdir.c
index e0c1eac8b..c1400d728 100644
--- a/nsprpub/pr/tests/rmdir.c
+++ b/nsprpub/pr/tests/rmdir.c
@@ -5,9 +5,9 @@
/*
** File: rmdir.c
-** Description: Demonstrate bugzilla 80884.
+** Description: Demonstrate bugzilla 80884.
**
-** after fix to unix_errors.c, message should report correct
+** after fix to unix_errors.c, message should report correct
** failure of PR_Rmdir().
**
**
@@ -24,7 +24,7 @@
#define FILENAME "file80883"
PRBool failed_already = PR_FALSE;
-PRBool debug_mode = PR_FALSE;
+PRBool debug_mode = PR_FALSE;
PRLogModuleInfo *lm;
@@ -33,8 +33,8 @@ PRLogModuleInfo *lm;
*/
static void Help( void ) {
fprintf(stderr, "template usage:\n"
- "\t-d debug mode\n"
- );
+ "\t-d debug mode\n"
+ );
} /* --- end Help() */
int main(int argc, char **argv)
@@ -46,7 +46,9 @@ int main(int argc, char **argv)
/* parse command line options */
while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) {
- if (PL_OPT_BAD == os) continue;
+ if (PL_OPT_BAD == os) {
+ continue;
+ }
switch (opt->option) {
case 'd': /* debug mode */
debug_mode = PR_TRUE;
@@ -66,11 +68,11 @@ int main(int argc, char **argv)
if (fd == 0) {
PRErrorCode err = PR_GetError();
fprintf(stderr, "create file fails: %d: %s\n", err,
- PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT));
+ PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT));
failed_already = PR_TRUE;
goto Finished;
}
-
+
PR_Close(fd);
if (PR_RmDir( DIRNAME ) == PR_SUCCESS) {
@@ -78,10 +80,10 @@ int main(int argc, char **argv)
failed_already = PR_TRUE;
goto Finished;
}
-
+
err = PR_GetError();
fprintf(stderr, "remove directory fails with: %d: %s\n", err,
- PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT));
+ PR_ErrorToString(err, PR_LANGUAGE_I_DEFAULT));
(void) PR_Delete( DIRNAME FILENAME);
(void) PR_RmDir( DIRNAME );
@@ -89,7 +91,9 @@ int main(int argc, char **argv)
return 0;
Finished:
- if ( debug_mode ) printf("%s\n", ( failed_already ) ? "FAILED" : "PASS" );
+ if ( debug_mode ) {
+ printf("%s\n", ( failed_already ) ? "FAILED" : "PASS" );
+ }
return( (failed_already)? 1 : 0 );
} /* --- end main() */
/* --- end template.c */