mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-10 15:05:13 +00:00
BAS: Another file is closer to the NuttX coding style
This commit is contained in:
parent
1655c81df0
commit
d18e4bb3ff
7 changed files with 1047 additions and 743 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -1,4 +1,3 @@
|
|||
/* #includes */ /*{{{C}}}*/
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_GETTEXT
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue