comparison libvo/vo_fbdev.c @ 29356:aba22a71e58f

10l, use fopen directly instead of open + fdopen
author reimar
date Fri, 26 Jun 2009 15:28:30 +0000
parents 288044ae1f9a
children 1de6b286ceb1
comparison
equal deleted inserted replaced
29355:288044ae1f9a 29356:aba22a71e58f
747 uint32_t format) 747 uint32_t format)
748 { 748 {
749 struct fb_cmap *cmap; 749 struct fb_cmap *cmap;
750 int vm = flags & VOFLAG_MODESWITCHING; 750 int vm = flags & VOFLAG_MODESWITCHING;
751 int zoom = flags & VOFLAG_SWSCALE; 751 int zoom = flags & VOFLAG_SWSCALE;
752 int vt_fd;
753 752
754 fs = flags & VOFLAG_FULLSCREEN; 753 fs = flags & VOFLAG_FULLSCREEN;
755 754
756 if (pre_init_err == -2) { 755 if (pre_init_err == -2) {
757 mp_msg(MSGT_VO, MSGL_ERR, "Internal fatal error: config() was called before preinit()\n"); 756 mp_msg(MSGT_VO, MSGL_ERR, "Internal fatal error: config() was called before preinit()\n");
968 mp_msg(MSGT_VO, MSGL_V, "pixel per line: %d\n", fb_line_len / fb_pixel_size); 967 mp_msg(MSGT_VO, MSGL_V, "pixel per line: %d\n", fb_line_len / fb_pixel_size);
969 968
970 if (fs || vm) 969 if (fs || vm)
971 memset(frame_buffer, '\0', fb_line_len * fb_yres); 970 memset(frame_buffer, '\0', fb_line_len * fb_yres);
972 } 971 }
973 if (vt_doit && (vt_fd = open("/dev/tty", O_WRONLY)) == -1) { 972 if (vt_doit && !(vt_fp = fopen("/dev/tty", "w"))) {
974 mp_msg(MSGT_VO, MSGL_ERR, "can't open /dev/tty: %s\n", strerror(errno)); 973 mp_msg(MSGT_VO, MSGL_ERR, "can't fopen /dev/tty: %s\n", strerror(errno));
975 vt_doit = 0;
976 }
977 if (vt_doit && !(vt_fp = fdopen(vt_fd, "w"))) {
978 mp_msg(MSGT_VO, MSGL_ERR, "can't fdopen /dev/tty: %s\n", strerror(errno));
979 vt_doit = 0; 974 vt_doit = 0;
980 } 975 }
981 976
982 if (vt_doit) 977 if (vt_doit)
983 vt_set_textarea(last_row, fb_yres); 978 vt_set_textarea(last_row, fb_yres);