BAS: Another file is closer to the NuttX coding style

This commit is contained in:
Gregory Nutt 2014-11-02 13:32:30 -06:00
parent 1655c81df0
commit d18e4bb3ff
7 changed files with 1047 additions and 743 deletions

View file

@ -61,11 +61,6 @@
* Included Files
****************************************************************************/
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
#include "config.h"
#include <assert.h>

View file

@ -107,29 +107,6 @@ static struct Value *eval(struct Value *value, const char *desc);
* Private Functions
****************************************************************************/
static char *mytmpnam(void)
{
static char buf[_POSIX_PATH_MAX];
const char *tmpdir;
unsigned int i;
int fd = -1;
if ((tmpdir = getenv("TMPDIR")) == (char *)0)
tmpdir = "/tmp";
if ((strlen(tmpdir) + 1 + 8 + 1) >= _POSIX_PATH_MAX)
return (char *)0;
i = getpid();
while (i < 0xffffffff &&
(snprintf(buf, sizeof(buf), "%s/%08x", tmpdir, i),
(fd = open(buf, O_RDWR | O_CREAT | O_EXCL, 0600))) == -1 &&
errno == EEXIST)
++i;
if (fd == -1)
return (char *)0;
close(fd);
return buf;
}
static int cat(const char *filename)
{
int fd;

View file

@ -60,11 +60,6 @@
* Included Files
****************************************************************************/
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
#include "config.h"
#include <unistd.h>

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,3 @@
/* #includes */ /*{{{C}}}*/
#include "config.h"
#ifdef HAVE_GETTEXT

View file

@ -60,11 +60,6 @@
* Included Files
****************************************************************************/
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
#include "config.h"
#include <assert.h>

View file

@ -2,11 +2,6 @@
* Included Files
****************************************************************************/
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2
#include "config.h"
#include <assert.h>