Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
380bb4be
Commit
380bb4be
authored
Mar 08, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* configure.ac: check for localtime_r().
* modules/control/telnet/vlm.c: portability fixes.
parent
4a1949b9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
configure.ac
configure.ac
+1
-1
modules/control/telnet/vlm.c
modules/control/telnet/vlm.c
+27
-21
No files found.
configure.ac
View file @
380bb4be
...
@@ -286,7 +286,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
...
@@ -286,7 +286,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
dnl Check for system libs needed
dnl Check for system libs needed
need_libc=false
need_libc=false
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r)
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r
localtime_r
)
dnl Check for usual libc functions
dnl Check for usual libc functions
AC_CHECK_FUNCS(strdup strndup atof lseek)
AC_CHECK_FUNCS(strdup strndup atof lseek)
...
...
modules/control/telnet/vlm.c
View file @
380bb4be
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* .c: VLM interface plugin
* .c: VLM interface plugin
*****************************************************************************
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* Copyright (C) 2000, 2001 VideoLAN
* $Id
: vlm.c,v 1.1 2004/03/05 14:03:20 garf Exp
$
* $Id$
*
*
* Authors: Simon Latapie <garf@videolan.org>
* Authors: Simon Latapie <garf@videolan.org>
* Laurent Aimar <fenrir@videolan.org>
* Laurent Aimar <fenrir@videolan.org>
...
@@ -1167,10 +1167,14 @@ static char *vlm_Show( vlm_t *vlm, vlm_media_t *media, vlm_schedule_t *schedule,
...
@@ -1167,10 +1167,14 @@ static char *vlm_Show( vlm_t *vlm, vlm_media_t *media, vlm_schedule_t *schedule,
if
(
schedule
->
i_date
!=
0
)
if
(
schedule
->
i_date
!=
0
)
{
{
char
psz_date
[
500
];
time_t
i_time
=
schedule
->
i_date
/
(
int64_t
)
1000000
;
time_t
i_time
=
schedule
->
i_date
/
(
int64_t
)
1000000
;
#ifdef HAVE_CTIME_R
char
psz_date
[
500
];
ctime_r
(
&
i_time
,
psz_date
);
ctime_r
(
&
i_time
,
psz_date
);
#else
char
*
psz_date
=
ctime
(
&
i_time
);
#endif
show
=
realloc
(
show
,
strlen
(
show
)
+
strlen
(
psz_date
)
+
1
);
show
=
realloc
(
show
,
strlen
(
show
)
+
strlen
(
psz_date
)
+
1
);
strcat
(
show
,
psz_date
);
strcat
(
show
,
psz_date
);
}
}
...
@@ -1353,11 +1357,16 @@ static char *vlm_Show( vlm_t *vlm, vlm_media_t *media, vlm_schedule_t *schedule,
...
@@ -1353,11 +1357,16 @@ static char *vlm_Show( vlm_t *vlm, vlm_media_t *media, vlm_schedule_t *schedule,
if
(
i_next_date
>
i_time
)
if
(
i_next_date
>
i_time
)
{
{
time_t
i_date
=
(
time_t
)
(
i_next_date
/
1000000
)
;
time_t
i_date
=
(
time_t
)
(
i_next_date
/
1000000
)
;
char
psz_date
[
500
];
#ifdef HAVE_CTIME_R
char
psz_date
[
500
];
ctime_r
(
&
i_date
,
psz_date
);
ctime_r
(
&
i_date
,
psz_date
);
#else
char
*
psz_date
=
ctime
(
&
i_date
);
#endif
show
=
realloc
(
show
,
strlen
(
show
)
+
strlen
(
psz_date
)
+
14
+
1
);
show
=
realloc
(
show
,
strlen
(
show
)
+
strlen
(
psz_date
)
+
14
+
1
);
strcat
(
show
,
" next launch: "
);
strcat
(
show
,
" next launch: "
);
strcat
(
show
,
psz_date
);
strcat
(
show
,
psz_date
);
}
}
...
@@ -1644,31 +1653,28 @@ static char *vlm_Save( vlm_t *vlm )
...
@@ -1644,31 +1653,28 @@ static char *vlm_Save( vlm_t *vlm )
{
{
vlm_schedule_t
*
schedule
=
vlm
->
schedule
[
i
];
vlm_schedule_t
*
schedule
=
vlm
->
schedule
[
i
];
struct
tm
date
;
struct
tm
date
;
time_t
i_time
;
time_t
i_time
=
(
time_t
)
(
schedule
->
i_date
/
1000000
);
p
+=
sprintf
(
p
,
"new %s schedule "
,
schedule
->
psz_name
);
i_time
=
(
time_t
)
(
schedule
->
i_date
/
1000000
);
#ifdef HAVE_LOCALTIME_R
localtime_r
(
&
i_time
,
&
date
);
localtime_r
(
&
i_time
,
&
date
);
#else
struct
tm
*
p_date
=
localtime
(
&
i_time
);
date
=
*
p_date
;
#endif
p
+=
sprintf
(
p
,
"new %s schedule "
,
schedule
->
psz_name
);
if
(
schedule
->
b_enabled
==
VLC_TRUE
)
if
(
schedule
->
b_enabled
==
VLC_TRUE
)
{
{
p
+=
sprintf
(
p
,
"date %d/%d/%d-%d:%d:%d enabled
\n
"
,
date
.
tm_year
+
1900
,
p
+=
sprintf
(
p
,
"date %d/%d/%d-%d:%d:%d enabled
\n
"
,
date
.
tm_mon
+
1
,
date
.
tm_year
+
1900
,
date
.
tm_mon
+
1
,
date
.
tm_mday
,
date
.
tm_mday
,
date
.
tm_hour
,
date
.
tm_min
,
date
.
tm_sec
);
date
.
tm_hour
,
date
.
tm_min
,
date
.
tm_sec
);
}
}
else
else
{
{
p
+=
sprintf
(
p
,
"date %d/%d/%d-%d:%d:%d disabled
\n
"
,
date
.
tm_year
+
1900
,
p
+=
sprintf
(
p
,
"date %d/%d/%d-%d:%d:%d disabled
\n
"
,
date
.
tm_mon
+
1
,
date
.
tm_year
+
1900
,
date
.
tm_mon
+
1
,
date
.
tm_mday
,
date
.
tm_mday
,
date
.
tm_hour
,
date
.
tm_min
,
date
.
tm_sec
);
date
.
tm_hour
,
date
.
tm_min
,
date
.
tm_sec
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment