Project

General

Profile

Cross-compiling tvheadend for openwrt (mips) ยป src.patch

Lyubomir Trifonov, 2011-04-07 14:43

View differences:

/usr/src/openwrt/tvheAdend/src/access.c 2011-04-07 12:45:26.000000000 +0300
37 37
#include "dtable.h"
38 38
#include "settings.h"
39 39

  
40

  
41
int SHA1_Init(SHA_CTX *c);
42
int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
43
int SHA1_Final(unsigned char *md, SHA_CTX *c);
44
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);
45
void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
46

  
47

  
40 48
struct access_entry_queue access_entries;
41 49
struct access_ticket_queue access_tickets;
42 50

  
......
210 218

  
211 219
  if(superuser_username != NULL && superuser_password != NULL) {
212 220

  
213
    SHA_Init(&shactx);
214
    SHA_Update(&shactx, (const uint8_t *)superuser_password,
221
    SHA1_Init(&shactx);
222
    SHA1_Update(&shactx, (const uint8_t *)superuser_password,
215 223
          strlen(superuser_password));
216
    SHA_Update(&shactx, challenge, 32);
217
    SHA_Final(d, &shactx);
224
    SHA1_Update(&shactx, challenge, 32);
225
    SHA1_Final(d, &shactx);
218 226

  
219 227
    if(!strcmp(superuser_username, username) && !memcmp(d, digest, 20))
220 228
      return 0xffffffff;
......
229 237
    if((b & ae->ae_netmask) != ae->ae_network)
230 238
      continue; /* IP based access mismatches */
231 239

  
232
    SHA_Init(&shactx);
233
    SHA_Update(&shactx, (const uint8_t *)ae->ae_password,
240
    SHA1_Init(&shactx);
241
    SHA1_Update(&shactx, (const uint8_t *)ae->ae_password,
234 242
         strlen(ae->ae_password));
235 243
    SHA1_Update(&shactx, challenge, 32);
236 244
    SHA1_Final(d, &shactx);
/usr/src/openwrt/tvheAdend/src/rawtsinput.c 2011-04-07 14:07:04.000000000 +0300
27 27
#include <stdio.h>
28 28
#include <string.h>
29 29
#include <errno.h>
30
#include <time.h>
30 31

  
31 32
#include "tvheadend.h"
32 33
#include "rawtsinput.h"
......
34 35
#include "tsdemux.h"
35 36
#include "channels.h"
36 37

  
38
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
39
	        __const struct timespec *__req,
40
	        struct timespec *__rem);
41

  
37 42
typedef struct rawts {
38 43
  int rt_fd;
39 44

  
......
266 271
     slp.tv_sec  =  d / 1000000;
267 272
     slp.tv_nsec = (d % 1000000) * 1000;
268 273
   
269
	  clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &slp, NULL);
274
	  //clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &slp, NULL);
270 275
     didsleep = 1;
271 276
   }
272 277
   t->s_pcr_last = pcr;
/usr/src/openwrt/tvheAdend/src/serviceprobe.c 2011-04-07 12:33:58.000000000 +0300
85 85
  streaming_message_t *sm;
86 86
  //  transport_feed_status_t status;
87 87
  int run;
88
  const char *err;
88
  const char *err=0;
89 89
  channel_t *ch;
90 90

  
91 91
  pthread_mutex_lock(&global_lock);
/usr/src/openwrt/tvheAdend/src/spawn.c 2011-04-07 12:30:34.000000000 +0300
30 30
#include "tvheadend.h"
31 31
#include "spawn.h"
32 32

  
33
/* uclibc does not define WIFCONTINUED(), workaround */ 
34
#ifndef WIFCONTINUED 
35
#define WIFCONTINUED(wstat) (0) 
36
#endif 
37

  
33 38
extern char **environ;
34 39

  
35 40
pthread_mutex_t spawn_mutex = PTHREAD_MUTEX_INITIALIZER;
    (1-1/1)