зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug # 138627 - mktemp() warnings when building ldapsearch.exe.
Use _mktemp() on Windows. Remove a couple of unused local variables.
This commit is contained in:
Родитель
5b27a00955
Коммит
dd4f8fc711
|
@ -251,7 +251,7 @@ cmp2( LDAP *ld1, LDAP *ld2, LDAPMessage *e1, int findonly)
|
|||
{
|
||||
LDAPMessage *e2, *res;
|
||||
char *dn, *attrcmp;
|
||||
int found=0, rc, msgid;
|
||||
int found=0, rc;
|
||||
ATTR *a1, *a2;
|
||||
|
||||
dn = ldap_get_dn( ld1, e1 );
|
||||
|
@ -546,7 +546,7 @@ print_entry( ld, entry, attrsonly )
|
|||
ldaptool_get_tmp_dir(), a );
|
||||
tmpfp = NULL;
|
||||
|
||||
if ( mktemp( tmpfname ) == NULL ) {
|
||||
if ( LDAPTOOL_MKTEMP( tmpfname ) == NULL ) {
|
||||
perror( tmpfname );
|
||||
} else if (( tmpfp = fopen( tmpfname, mode)) == NULL ) {
|
||||
perror( tmpfname );
|
||||
|
|
|
@ -295,7 +295,7 @@ main( int argc, char **argv )
|
|||
static void
|
||||
options_callback( int option, char *optarg )
|
||||
{
|
||||
char *s, *p, *temp_arg, *ps_ptr, *ps_arg;
|
||||
char *s, *temp_arg, *ps_ptr, *ps_arg;
|
||||
int i=0;
|
||||
|
||||
switch( option ) {
|
||||
|
@ -910,7 +910,7 @@ print_entry( ld, entry, attrsonly )
|
|||
#endif
|
||||
tmpfp = NULL;
|
||||
|
||||
if ( mktemp( tmpfname ) == NULL ) {
|
||||
if ( LDAPTOOL_MKTEMP( tmpfname ) == NULL ) {
|
||||
perror( tmpfname );
|
||||
} else if (( tmpfp = fopen( tmpfname, mode)) == NULL ) {
|
||||
perror( tmpfname );
|
||||
|
|
|
@ -53,10 +53,14 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
extern int getopt (int argc, char *const *argv, const char *optstring);
|
||||
#include <io.h> /* for _mktemp() */
|
||||
#define LDAPTOOL_MKTEMP( p ) _mktemp( p )
|
||||
#else
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define LDAPTOOL_MKTEMP( p ) mktemp( p )
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
|
Загрузка…
Ссылка в новой задаче