psxhdrs: Align the code properly to left hand margin

This commit is contained in:
Himanshu40
2018-12-05 20:58:39 +05:30
committed by Joel Sherrill
parent 7fe5922a5f
commit e15ae5a3a1
11 changed files with 310 additions and 346 deletions

View File

@@ -3,37 +3,37 @@
* @brief alphasort() API Conformance Test * @brief alphasort() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int test( void ) int test( void )
{ {
const struct dirent **d1 = NULL; const struct dirent **d1 = NULL;
const struct dirent **d2 = NULL; const struct dirent **d2 = NULL;
int result; int result;
result = alphasort( d1, d2 ); result = alphasort( d1, d2 );
return result; return result;
} }

View File

@@ -3,37 +3,37 @@
* @brief closedir() API Conformance Test * @brief closedir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int test( void ) int test( void )
{ {
DIR *dir; DIR *dir;
int result; int result;
dir = opendir( "/" ); dir = opendir( "/" );
result = closedir( dir ); result = closedir( dir );
return result; return result;
} }

View File

@@ -3,37 +3,37 @@
* @brief dirfd() API Conformance Test * @brief dirfd() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
int result; int result;
dirp = opendir( "/" ); dirp = opendir( "/" );
result = dirfd( dirp ); result = dirfd( dirp );
return result; return result;
} }

View File

@@ -3,47 +3,40 @@
* @brief fdopendir() API Conformance Test * @brief fdopendir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
int test( void ); int test( void );
int pass = 1; int test( void )
{
int fd;
DIR *result;
int test( void ) fd = open( "./", O_RDONLY );
{ result = fdopendir( fd );
int fd;
DIR *result;
if( pass == 1 ) return ( result != NULL );
{
fd = open( "./", O_RDONLY );
result = fdopendir( fd );
(void) result;
pass = 0;
}
return pass;
} }

View File

@@ -3,42 +3,35 @@
* @brief opendir() API Conformance Test * @brief opendir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int result = 1; int test( void )
{
DIR *dir;
int test( void ) dir = opendir( "/" );
{
DIR *dir;
if( result == 1 ) return ( dir != NULL );
{ }
dir = opendir( "/" );
(void) dir;
result = 0;
}
return result;
}

View File

@@ -3,43 +3,37 @@
* @brief readdir() API Conformance Test * @brief readdir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int pass = 1;
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
struct dirent *result; struct dirent *result;
if( pass == 1 ) dirp = opendir( "/" );
{ result = readdir( dirp );
dirp = opendir( "/" );
result = readdir( dirp );
(void) result;
pass = 0;
}
return pass; return ( result != NULL );
} }

View File

@@ -3,40 +3,40 @@
* @brief readdir_r() API Conformance Test * @brief readdir_r() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
struct dirent *entry = NULL; struct dirent *entry = NULL;
struct dirent *result = NULL; struct dirent *result = NULL;
int pass; int pass;
dirp = opendir( "/" ); dirp = opendir( "/" );
entry = readdir(dirp); entry = readdir(dirp);
pass = readdir_r( dirp, entry, &result); pass = readdir_r( dirp, entry, &result);
return pass; return pass;
} }

View File

@@ -3,41 +3,36 @@
* @brief rewinddir() API Conformance Test * @brief rewinddir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int result = 1;
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
if( result == 1 ) dirp = opendir( "/" );
{ rewinddir( dirp );
dirp = opendir( "/" );
rewinddir( dirp );
result = 0;
}
return result; return ( dirp != NULL );
} }

View File

@@ -3,36 +3,36 @@
* @brief scandir() API Conformance Test * @brief scandir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int test( void ) int test( void )
{ {
struct dirent **namelist; struct dirent **namelist;
int result; int result;
result = scandir( ".", &namelist, NULL, alphasort ); result = scandir( ".", &namelist, NULL, alphasort );
return result; return result;
} }

View File

@@ -3,43 +3,38 @@
* @brief seekdir() API Conformance Test * @brief seekdir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int result = 1;
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
long loc; long loc;
if( result == 1 ) dirp = opendir( "/" );
{ loc = telldir( dirp );
dirp = opendir( "/" ); seekdir( dirp, loc );
loc = telldir( dirp );
seekdir( dirp, loc );
result = 0;
}
return result; return ( (int)loc );
} }

View File

@@ -3,43 +3,37 @@
* @brief telldir() API Conformance Test * @brief telldir() API Conformance Test
*/ */
/* /*
* COPYRIGHT (c) 2018. * COPYRIGHT (c) 2018.
* Himanshu Sekhar Nayak * Himanshu Sekhar Nayak
* *
* Permission to use, copy, modify, and/or distribute this software * Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted. * for any purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include <dirent.h> #include <dirent.h>
int test( void ); int test( void );
int result = 1;
int test( void ) int test( void )
{ {
DIR *dirp; DIR *dirp;
long loc; long loc;
if( result == 1 ) dirp = opendir( "/" );
{ loc = telldir( dirp );
dirp = opendir( "/" );
loc = telldir( dirp );
(void) loc;
result = 0;
}
return result; return ( (int)loc );
} }