www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2014/01/14/05:40:47

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
From: Martin Str|mberg <ams AT ludd DOT ltu DOT se>
Message-Id: <201401141024.s0EAO5jE018027@dexter.ludd.ltu.se>
Subject: Re: Implementation of mkdtemp.
To: djgpp-workers AT delorie DOT com
Date: Tue, 14 Jan 2014 11:24:05 +0100 (MET)
In-Reply-To: <52D08912.4080904@gmx.de> from "Juan Manuel Guerrero" at Jan 11, 2014 12:58:10 AM
X-Mailer: ELM [version 2.5 PL6]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

According to Juan Manuel Guerrero:
> diff -aprNU5 djgpp.orig/src/libc/compat/stdio/mktemp.c djgpp/src/libc/compat/stdio/mktemp.c
> --- djgpp.orig/src/libc/compat/stdio/mktemp.c    2013-12-31 14:54:02 +0100
> +++ djgpp/src/libc/compat/stdio/mktemp.c    2014-01-09 22:24:06 +0100
> @@ -1,82 +1,99 @@
> +/* Copyright (C) 2014 DJ Delorie, see COPYING.DJ for details */
>   /* Copyright (C) 2013 DJ Delorie, see COPYING.DJ for details */
>   /* Copyright (C) 2009 DJ Delorie, see COPYING.DJ for details */
>   /* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
>   /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
>   /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
>   #include <libc/stubs.h>
>   #include <libc/bss.h>
>   #include <libc/symlink.h>
> +#include <fcntl.h>
>   #include <unistd.h>
>   #include <stdlib.h>
>   #include <stdio.h>
>   #include <string.h>
> +#include <errno.h>
> 
>   static int mktemp_count = -1;
> 
>   char *
>   mktemp(char *_template)
>   {
> -  static int count = 0;
> -  char *cp, *dp;
> -  int i, len, xcount, loopcnt;
> -  char real_path[FILENAME_MAX];
> +  register int i, len, xcount;
> +  unsigned int use_lfn = _USE_LFN;

Hrrm... Declaring variables with register in C is considered bad form
nowadays.

May I ask why you'd do so?


Nevertheless, thanks for all your work.


-- 
MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019