MultiByteToWideChar( CP_ACP, 0, psz_dirname, -1, psz_new, MAX_PATH );
if( CreateDirectory( psz_new, NULL ) )
{
- msg_Err( p_this, "could not create %s", psz_filename );
+ msg_Err( p_this, "could not create %s", psz_dirname );
}
}
#if defined(WIN32) || defined(UNDER_CE)
typedef HRESULT (WINAPI *SHGETFOLDERPATH)( HWND, int, HANDLE, DWORD,
LPSTR );
+#ifndef CSIDL_FLAG_CREATE
# define CSIDL_FLAG_CREATE 0x8000
+#endif
+#ifndef CSIDL_APPDATA
# define CSIDL_APPDATA 0x1A
+#endif
+#ifndef SHGFP_TYPE_CURRENT
# define SHGFP_TYPE_CURRENT 0
+#endif
HINSTANCE shfolder_dll;
SHGETFOLDERPATH SHGetFolderPath ;
timeout.tv_usec = b_block ? 500000 : i_wait;
i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout);
+#ifdef HAVE_ERRNO_H
if( (i_ret < 0 && errno == EINTR) || i_ret == 0 )
+#else
+ if( i_ret == 0 )
+#endif
{
if( b_block ) continue;
else return -1;
}
else if( i_ret < 0 )
{
-#ifdef WIN32
+#if defined(WIN32) || defined(UNDER_CE)
msg_Err( p_this, "network select error (%i)", WSAGetLastError() );
#else
msg_Err( p_this, "network select error (%s)", strerror(errno) );
if( ( i_ret = accept( fd, 0, 0 ) ) <= 0 )
{
-#ifdef WIN32
+#if defined(WIN32) || defined(UNDER_CE)
msg_Err( p_this, "accept failed (%i)", WSAGetLastError() );
#else
msg_Err( p_this, "accept failed (%s)", strerror(errno) );
timeout.tv_usec = 500000;
} while( (i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout)) == 0
+#ifdef HAVE_ERRNO_H
|| ( i_ret < 0 && errno == EINTR ) );
+#else
+ );
+#endif
if( i_ret < 0 )
{
+#if defined(WIN32) || defined(UNDER_CE)
+ msg_Err( p_this, "network select error" );
+#else
msg_Err( p_this, "network select error (%s)", strerror(errno) );
+#endif
return i_total > 0 ? i_total : -1;
}
if( ( i_recv = recv( fd, p_data, i_data, 0 ) ) < 0 )
{
-#ifdef WIN32
+#if defined(WIN32) || defined(UNDER_CE)
/* For udp only */
/* On win32 recv() will fail if the datagram doesn't fit inside
* the passed buffer, even though the buffer will be filled with
i_ret = select(fd + 1, &fds_r, NULL, &fds_e, &timeout);
+#ifdef HAVE_ERRNO_H
if( i_ret < 0 && errno == EINTR )
+#else
+ if( 0 )
+#endif
{
return 0;
}
else if( i_ret < 0 )
{
+#if defined(WIN32) || defined(UNDER_CE)
+ msg_Err( p_this, "network select error" );
+#else
msg_Err( p_this, "network select error (%s)", strerror(errno) );
+#endif
return -1;
}
else if( i_ret == 0)
}
else
{
- if( fd == 0 /*STDIN_FILENO*/ ) i_recv = read( fd, p_data, i_data ); else
+#if !defined(UNDER_CE)
+ if( fd == 0/*STDIN_FILENO*/ ) i_recv = read( fd, p_data, i_data ); else
+#endif
if( ( i_recv = recv( fd, p_data, i_data, 0 ) ) <= 0 )
{
-#ifdef WIN32
+#if defined(WIN32) || defined(UNDER_CE)
/* For udp only */
/* On win32 recv() will fail if the datagram doesn't fit inside
* the passed buffer, even though the buffer will be filled with
timeout.tv_usec = 500000;
} while( (i_ret = select(fd + 1, NULL, &fds_w, &fds_e, &timeout)) == 0
+#ifdef HAVE_ERRNO_H
|| ( i_ret < 0 && errno == EINTR ) );
+#else
+ );
+#endif
if( i_ret < 0 )
{
+#if defined(WIN32) || defined(UNDER_CE)
+ msg_Err( p_this, "network select error" );
+#else
msg_Err( p_this, "network select error (%s)", strerror(errno) );
+#endif
return i_total > 0 ? i_total : -1;
}
{
schedule->b_enabled = VLC_FALSE;
}
+#if !defined( UNDER_CE )
else if( strcmp( psz_cmd, "date" ) == 0 )
{
struct tm time;
date = (((( time.tm_year * 12 + time.tm_mon ) * 30 + time.tm_mday ) * 24 + time.tm_hour ) * 60 + time.tm_min ) * 60 + time.tm_sec ;
schedule->i_period = ((mtime_t) date) * 1000000;
}
+#endif /* UNDER_CE */
else if( strcmp( psz_cmd, "repeat" ) == 0 )
{
int i;
vlm_MessageNew( "enabled", schedule->b_enabled ?
"yes" : "no" ) );
+#if !defined( UNDER_CE )
if( schedule->i_date != 0 )
{
struct tm date;
{
vlm_MessageAdd( msg_schedule, vlm_MessageNew("period", "0") );
}
+#endif /* UNDER_CE */
sprintf( buffer, "%d", schedule->i_repeat );
vlm_MessageAdd( msg_schedule, vlm_MessageNew( "repeat", buffer ) );
{
time_t i_date = (time_t) (i_next_date / 1000000) ;
+#if !defined( UNDER_CE )
#ifdef HAVE_CTIME_R
char psz_date[500];
ctime_r( &i_date, psz_date );
vlm_MessageAdd( msg_schedule,
vlm_MessageNew( "next launch", psz_date ) );
+#endif
}
}
}
/* and now, the schedule scripts */
-
+#if !defined( UNDER_CE )
for( i = 0; i < vlm->i_schedule; i++ )
{
vlm_schedule_t *schedule = vlm->schedule[i];
}
}
+#endif /* UNDER_CE */
return save;
}