Bug 130132 - [EFL][WK2] Fix compilation warning in Minibrowser
Summary: [EFL][WK2] Fix compilation warning in Minibrowser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-12 08:42 PDT by Sanghyup Lee
Modified: 2014-03-13 19:31 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.43 KB, patch)
2014-03-12 08:49 PDT, Sanghyup Lee
no flags Details | Formatted Diff | Diff
Patch (1.52 KB, patch)
2014-03-12 18:08 PDT, Sanghyup Lee
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sanghyup Lee 2014-03-12 08:42:33 PDT
Replace mktemp() to mkdtemp() to fix compilation warning in MiniBrowser.

CMakeFiles/MiniBrowser.dir/main.c.o: In function `on_download_request':
main.c:(.text.on_download_request+0x71): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
Comment 1 Sanghyup Lee 2014-03-12 08:49:27 PDT
Created attachment 226511 [details]
Patch
Comment 2 Csaba Osztrogonác 2014-03-12 10:15:05 PDT
Comment on attachment 226511 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=226511&action=review

> Tools/ChangeLog:8
> +        Replace mktemp() with mkdtemp() to fix compilation warning in MiniBrowser.

typo: you meant mkstemp instead of mkdtemp

> Tools/MiniBrowser/efl/main.c:606
> -        eina_strbuf_append(destination_path, mktemp(unique_path));
> +        mkstemp(unique_path);
> +        eina_strbuf_append(destination_path, unique_path);

Shouldn't we check if the return value is -1 ?
Comment 3 Sanghyup Lee 2014-03-12 18:08:52 PDT
Created attachment 226566 [details]
Patch
Comment 4 Sanghyup Lee 2014-03-12 18:20:41 PDT
(In reply to comment #3)
> Created an attachment (id=226566) [details]
> Patch

(In reply to comment #2)
> (From update of attachment 226511 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226511&action=review
> 
> > Tools/ChangeLog:8
> > +        Replace mktemp() with mkdtemp() to fix compilation warning in MiniBrowser.
> 
> typo: you meant mkstemp instead of mkdtemp
> 
> > Tools/MiniBrowser/efl/main.c:606
> > -        eina_strbuf_append(destination_path, mktemp(unique_path));
> > +        mkstemp(unique_path);
> > +        eina_strbuf_append(destination_path, unique_path);
> 
> Shouldn't we check if the return value is -1 ?

Thanks for review. I fixed it.
Comment 5 Sanghyup Lee 2014-03-12 18:22:05 PDT
(In reply to comment #2)
> (From update of attachment 226511 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=226511&action=review
> 
> > Tools/ChangeLog:8
> > +        Replace mktemp() with mkdtemp() to fix compilation warning in MiniBrowser.
> 
> typo: you meant mkstemp instead of mkdtemp
> 
> > Tools/MiniBrowser/efl/main.c:606
> > -        eina_strbuf_append(destination_path, mktemp(unique_path));
> > +        mkstemp(unique_path);
> > +        eina_strbuf_append(destination_path, unique_path);
> 
> Shouldn't we check if the return value is -1 ?

Thanks for review. I fixed it.
Comment 6 WebKit Commit Bot 2014-03-13 19:31:53 PDT
Comment on attachment 226566 [details]
Patch

Clearing flags on attachment: 226566

Committed r165596: <http://trac.webkit.org/changeset/165596>
Comment 7 WebKit Commit Bot 2014-03-13 19:31:56 PDT
All reviewed patches have been landed.  Closing bug.